GHSA-xm96-gfjx-jcrc ORAS Java: Path traversal in pullArtifact via attacker-controlled org.opencontainers.image.title annotation

Not scored Published

Attackers can write arbitrary files outside the intended directory by manipulating OCI manifest annotations during artifact pulls in the ORAS Java library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is GHSA-xm96-gfjx-jcrc?

GHSA-xm96-gfjx-jcrc is a path traversal vulnerability in land.oras:oras-java-sdk, published on 19 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Summary

The pullArtifact methods in Registry and OCILayout use the org.opencontainers.image.title annotation from a pulled manifest as a filename, resolving it against the caller supplied output directory without normalization or a containment check. A manifest publisher can set this annotation to a path that escapes the output directory, causing the SDK to write the layer's blob anywhere the JVM process can write.

Details

Two call sites are affected.

src/main/java/land/oras/Registry.java, pullLayer (reached from Registry.pullArtifact):

Path targetPath = path.resolve(layer.getAnnotations().get(Const.ANNOTATION_TITLE));
...
Files.copy(is, targetPath, StandardCopyOption.REPLACE_EXISTING);

src/main/java/land/oras/OCILayout.java, OCILayout.pullArtifact:

Files.copy(blobPath, path.resolve(layer.getAnnotations().get(Const.ANNOTATION_TITLE)));

The annotation comes from the remote manifest. Path.resolve treats an absolute argument as a full override of the base, and follows .. segments upward, so the annotation controls the destination. REPLACE_EXISTING overwrites files that exist at that destination.

The unpack branch of pullLayer (taken when the layer carries io.deis.oras.content.unpack=true) is not affected, because it dispatches through ArchiveUtils.untar / unzip, which apply outputPath.startsWith(normalizedTarget) after normalization. The non unpack branch and OCILayout.pullArtifact lack the equivalent check.

fetchBlob(ContainerRef, Path) is not affected. The caller passes the destination path and the title annotation is not consulted.

Which versions are affected by GHSA-xm96-gfjx-jcrc?

2 open source packages ship an affected version, including land.oras:oras-java-sdk.

PackageAffectedFixed in
land.oras:oras-java-sdk MavenAll versions0.6.2
land.oras:oras-java-sdk MavenAll versions0.6.2

How do I fix GHSA-xm96-gfjx-jcrc?

Upgrade land.oras:oras-java-sdk to 0.6.2 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is GHSA-xm96-gfjx-jcrc being exploited?

There is no known exploitation of GHSA-xm96-gfjx-jcrc in the wild and no public exploit code.

Sources

Is GHSA-xm96-gfjx-jcrc in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free