High

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

  • Disclosed: 19.05.2026
  • Updated: 11.10.2026 12:22

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):

java
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:

java
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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) land.oras:oras-java-sdk < 0.6.2 0.6.2

References

CVSS score 8.1/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
Weakness (CWE)
CWE-22
Platform
Java / Kotlin (Maven)
Package
land.oras:oras-java-sdk
Disclosed
19.05.2026
Updated
11.10.2026 12:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-xm96-gfjx-jcrc - CC BY 4.0

Vulnerability history: land.oras:oras-java-sdk

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
05.2026 07.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 1
  • Low 1

Disclosures per year

  1. 2026: 2
  1. ORAS Java: Path traversal in pullArtifact via attacker-controlled org.opencontainers.image.title annotation this entry
    High · 8.1 ghsa-xm96-gfjx-jcrc < 0.6.2 0.6.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.