GHSA-xm96-gfjx-jcrc: ORAS Java Path Traversal Vulnerability

HIGH
CVSS 8.1
CWE-22
Published
Advisory Summary

GHSA-xm96-gfjx-jcrc is a HIGH (CVSS 8.1) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting ORAS Java libraries in the Maven ecosystem. The issue involves path traversal in pullartifact via attacker-controlled org.opencontainers.image.title annotation. Remediation is available by upgrading affected packages to version 0.6.2.

GHSA-xm96-gfjx-jcrc at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-xm96-gfjx-jcrc
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product ORAS Java
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-xm96-gfjx-jcrc

To remediate this vulnerability, upgrade all affected ORAS Java dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

land.oras:oras-java-sdk fixed: 0.6.2
<dependency>
    <groupId>land.oras</groupId>
    <artifactId>oras-java-sdk</artifactId>
    <version>0.6.2</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=land.oras

How to Check if You Are Affected

To determine whether your Java application is affected by GHSA-xm96-gfjx-jcrc, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=land.oras

Analyze the terminal output to locate any version of ORAS Java in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.2), your application is affected.

Note: The mvn dependency:tree -Dincludes=land.oras command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In ORAS Java, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

GHSA-xm96-gfjx-jcrc Affected ORAS Java Versions

1 component(s)
Fixed Versions:
0.6.2
Product / Package Ecosystem Affected Versions Fixed Version
land.oras:oras-java-sdk
Maven
< 0.6.2
0.6.2

References

Frequently Asked Questions

What is GHSA-xm96-gfjx-jcrc?
GHSA-xm96-gfjx-jcrc is a security vulnerability in ORAS Java involving Path traversal in pullArtifact via attacker-controlled org.opencontainers.image.title annotation under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which ORAS Java versions are affected?
Affected versions include releases prior to 0.6.2 across affected packages: land.oras:oras-java-sdk.
What version fixes GHSA-xm96-gfjx-jcrc?
Upgrading to 0.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is oras-java-sdk affected?
Yes, land.oras:oras-java-sdk is affected in releases prior to 0.6.2. Upgrade your dependency to 0.6.2 or later.
What is the CVSS score of GHSA-xm96-gfjx-jcrc?
GHSA-xm96-gfjx-jcrc has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H.
What CWE is associated with GHSA-xm96-gfjx-jcrc?
GHSA-xm96-gfjx-jcrc is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Maven dependencies for GHSA-xm96-gfjx-jcrc?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=land.oras'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xm96-gfjx-jcrc",
  "modified" : "2026-05-19T15:47:36Z",
  "published" : "2026-05-19T15:47:36Z",
  "aliases" : [ ],
  "summary" : "ORAS Java: Path traversal in pullArtifact via attacker-controlled org.opencontainers.image.title annotation",
  "details" : "### Summary\n\nThe `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.\n\n### Details\n\nTwo call sites are affected.\n\n`src/main/java/land/oras/Registry.java`, `pullLayer` (reached from `Registry.pullArtifact`):\n\n```java\nPath targetPath = path.resolve(layer.getAnnotations().get(Const.ANNOTATION_TITLE));\n...\nFiles.copy(is, targetPath, StandardCopyOption.REPLACE_EXISTING);\n```\n\n`src/main/java/land/oras/OCILayout.java`, `OCILayout.pullArtifact`:\n\n```java\nFiles.copy(blobPath, path.resolve(layer.getAnnotations().get(Const.ANNOTATION_TITLE)));\n```\n\nThe 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.\n\nThe 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.\n\n`fetchBlob(ContainerRef, Path)` is not affected. The caller passes the destination path and the title annotation is not consulted.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "land.oras:oras-java-sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.6.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/oras-project/oras-java/security/advisories/GHSA-xm96-gfjx-jcrc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/oras-project/oras-java"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-19T15:47:36Z",
    "nvd_published_at" : null
  }
}