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

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

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 19 May 2026

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

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

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `land.oras:oras-java-sdk` | Maven | All versions | 0.6.2 |
| `land.oras:oras-java-sdk` | Maven | All versions | 0.6.2 |

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

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

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

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-xm96-gfjx-jcrc and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of GHSA-xm96-gfjx-jcrc in the wild and no public exploit code.

Affected packages and fixed versions:
- land.oras:oras-java-sdk (Maven): affected all versions; fixed in 0.6.2
- land.oras:oras-java-sdk (Maven): affected all versions; fixed in 0.6.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-xm96-gfjx-jcrc/ (Markdown: https://insights.sbomify.com/GHSA-xm96-gfjx-jcrc/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-xm96-gfjx-jcrc

---
From sbomify Insights: https://insights.sbomify.com/GHSA-xm96-gfjx-jcrc/
Summaries are generated and may contain mistakes; the official description above is the record.
