CVE-2026-50162: oras-go: file store write outside workingDir via symlink traversal

Published Jul 1, 2026
·
Updated

oras-go is a Go library for managing OCI artifacts. Prior to 2.6.1, resolveWritePath() in content/file/file.go uses a lexical filepath.Rel check for workingDir and does not account for symlink traversal, so when AllowPathTraversalOnWrite=false an attacker-controlled blob title through ocispec.AnnotationTitle such as out/pwn.txt can follow a workingDir symlink out - /some/outside/dir and cause pushFile() to create /some/outside/dir/pwn.txt outside workingDir. This issue is fixed in version 2.6.1.

Other sources

oras-go is a Go library for managing OCI artifacts. Prior to 2.6.1, resolveWritePath() in content/file/file.go uses a lexical filepath.Rel check for workingDir and does not account for symlink traversal, so when AllowPathTraversalOnWrite=false an attacker-controlled blob title through ocispec.AnnotationTitle such as out/pwn.txt can follow a workingDir symlink out -> /some/outside/dir and cause pushFile() to create /some/outside/dir/pwn.txt outside workingDir. This issue is fixed in version 2.6.1.

MITRE

The file content store in oras-go attempts to confine writes to workingDir when AllowPathTraversalOnWrite=false, but the guard is lexical and does not account for symlink traversal. If workingDir contains a symlink path component and an attacker-controlled blob title (via ocispec.AnnotationTitle) targets a path under that symlink, pushFile() can create a file outside workingDir.

relevant links

- repository: https://github.com/oras-project/oras-go - commit: 03243809936cce826494b5506f724c6dc11115b1 - callsite: content/file/file.go:609 resolveWritePath() (used by pushFile())

vulnerability details

pins: oras-project/oras-go@03243809936cce826494b5506f724c6dc11115b1

as-of: 2026-02-17

policy: GitHub Security Advisory (oras-project/oras-go)

callsite: content/file/file.go:609 resolveWritePath() → pushFile()

attacker control: Attacker controls the pushed name (ocispec.AnnotationTitle) and can select a path with a symlink path component under workingDir → resolveWritePath() blocks .. via filepath.Rel but does not prevent symlink traversal → pushFile() opens/creates the final path and follows the symlink → a file is created outside workingDir

root cause

resolveWritePath() enforces the write boundary using a filepath.Rel-style check against workingDir. This prevents ../ escapes but is purely lexical and does not resolve symlinks. If a path component under workingDir is a symlink to an external location, the subsequent filesystem operation in pushFile() follows that symlink and performs the write outside workingDir while still passing the lexical boundary check.

attack path

1. Attacker provides a blob title (via ocispec.AnnotationTitle) that contains a path like out/pwn.txt. 2. Victim uses oras-go file store with AllowPathTraversalOnWrite=false and a workingDir that contains a symlink directory out -> /some/outside/dir. 3. The lexical boundary check accepts out/pwn.txt as being under workingDir. 4. The write follows the symlink and creates /some/outside/dir/pwn.txt.

impact

This is a filesystem boundary bypass that permits writes outside workingDir when a symlink path component exists under workingDir. The concrete security impact depends on the runtime environment (what filesystem locations are writable by the process and what downstream consumers do with the written file), but the intended confinement guarantee is violated.

proof of concept

the attached poc.zip contains a small, self-contained go harness that demonstrates:

- canonical (vulnerable): prints [CALLSITEHIT] and [PROOFMARKER] and shows the file is created outside workingDir - control (no symlink component): prints [NCMARKER] and confirms no outside write occurs

run:

bash unzip -q -o poc.zip -d /tmp cd /tmp/poc-F-ORAS-SYMLINK-WRITE-001 make test

expected: when AllowPathTraversalOnWrite=false, file store writes should not be able to escape workingDir, including via symlink traversal.

actual: A symlink path component under workingDir allows writes to escape workingDir even when AllowPathTraversalOnWrite=false.

recommended fix

ensure confinement checks account for symlink traversal. Options include rejecting symlinks in any path component (walk components with os.Lstat), validating the resolved parent directory via EvalSymlinks and enforcing it remains under the resolved workingDir, or using an openat()-style approach so the check and open happen relative to a trusted directory file descriptor.

fix accepted when: The canonical PoC no longer prints [PROOFMARKER] for the same attacker-controlled inputs.

cheers, Oleh

GitHub

Affected Software

2 affected componentsFixes available
go/oras.land/oras-go/v2<2.6.1
2.6.1
IBM Netezza Software<=11.3.0.3-IF2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/oras.land/oras-go/v2 to a version that resolves this vulnerability.

    Fixed in 2.6.1
  2. Upgrade

    Upgrade oras-project/oras-go to a version that resolves this vulnerability.

    Fixed in 2.6.1Patch 03243809936cce826494b5506f724c6dc11115b1
  3. Compensating control

    Ensure confinement checks account for symlink traversal (e.g., reject symlinks in any path component via os.Lstat, validate the resolved parent directory via EvalSymlinks to remain under the resolved workingDir, or use an openat()-style approach so the check and open happen relative to a trusted directory file descriptor).

Event History

Jul 1, 2026
Advisory Published
via GitHub·09:43 PM
Data Sourced
via GitHub·09:43 PM
DescriptionWeaknessAffected Software
Jul 17, 2026
CVE Published
via MITRE·07:39 PM
Data Sourced
via MITRE·07:39 PM
DescriptionWeakness
Data Sourced
via NVD·08:17 PM
DescriptionSeverityWeakness
Aug 20, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2026-50162?

The severity of CVE-2026-50162 is rated at risk level 52.

2

How do I fix CVE-2026-50162?

To fix CVE-2026-50162, ensure that symlink paths are not allowed in the `workingDir`, or upgrade to a patched version of `oras-go` that addresses the issue.

3

What is the impact of CVE-2026-50162?

CVE-2026-50162 allows an attacker to exploit symlink traversal vulnerabilities, potentially leading to unauthorized file access.

4

Which software is affected by CVE-2026-50162?

CVE-2026-50162 affects the `oras-go` library specifically version 2.

5

What type of vulnerability is CVE-2026-50162?

CVE-2026-50162 is a file inclusion vulnerability due to improper handling of symlink paths.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203