Path Traversal in oras.land/oras-go/v2 (CVE-2026-85731)
Summary
Path traversal in oras.land/oras-go/v2 (CVE-2026-85731). Successful exploitation can lead to full system takeover. Exploitable via filepath.Join. Mitigation: upgrade to 2.6.2 or later.
Original description
The description as published by the source.
Summary
The content/file.Store in oras-go v2 unpacks OCI layer tarballs when a descriptor carries io.deis.oras.content.unpack=true. The extraction routine validates symlink targets purely lexically (filepath.Join) and, for regular files placed directly at the extraction root, skips the parent-symlink Lstat walk. A malicious tarball can plant a chain of symlinks whose lexical target stays inside the extraction root but whose kernel-resolved target is any absolute path, then write through it with a follow-up regular-file entry. The result is arbitrary file create/overwrite outside the store's working directory under the default AllowPathTraversalOnWrite=false configuration — a canonical tar-slip → RCE primitive.
Details
Affected versions: <= v2.6.1
Entry point: content/file/file.go line 486, (*Store).pushDir — reached from (*Store).Push for any descriptor whose annotations include io.deis.oras.content.unpack: "true" (i.e. file.AnnotationUnpack) and an org.opencontainers.image.title. oras.Copy from a remote registry into a file.New(dir) store invokes this per layer.
Root cause 1 — lexical link validation. content/file/utils.go lines 264–275, ensureLinkPath:
func ensureLinkPath(baseAbs, baseRel, link, target string) (string, error) {
// resolve link
path := target
if !filepath.IsAbs(target) {
path = filepath.Join(filepath.Dir(link), target)
}
// ensure path is und…
Source: NIST National Vulnerability Database NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-85731 has been found in oras.land/oras-go/v2.
Attackers can target a specific entry point like filepath.Join over the network to misuse the product.
Successful exploitation can lead to full system takeover. CVSS score: 8.8/10.
What to do: upgrade oras.land/oras-go/v2 to 2.6.2 or later.
If unsure, ask your IT team or search "oras.land/oras-go/v2 CVE-2026-85731" on the vendor's site.
CVE-2026-85731 (oras.land/oras-go/v2) — CWE-22 / CVSS v3 8.8
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: filepath.Join / Lstat / file.AnnotationUnpack / org.opencontainers.image.title
Patched: 2.6.2 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Path traversal (CWE-22) exists in oras.land/oras-go/v2. Attackers reach the vulnerable code path via filepath.Join without authentication.
Check the vendor advisory for the affected versions of oras.land/oras-go/v2. Attack surface: filepath.Join / Lstat / file.AnnotationUnpack / org.opencontainers.image.title.
Severity: High (CVSS 8.8/10). Successful exploitation can lead to full system takeover.
Update to 2.6.2.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'oras.land/oras-go/v2' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'oras.land/oras-go/v2' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
oras.land/oras-go/v2を grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade oras.land/oras-go/v2 to 2.6.2ステージング環境で 2.6.2 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com