Renovate: Update module oras.land/oras-go/v2 to v2.6.2 [SECURITY] - #41
Renovate: Update module oras.land/oras-go/v2 to v2.6.2 [SECURITY]#41renovate[bot] wants to merge 1 commit into
Conversation
ℹ️ Artifact update noticeFile name: go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
23ae74e to
a73c82f
Compare
44e470c to
f075586
Compare
cbaaaf1 to
3a5e065
Compare
3a5e065 to
77fc3cb
Compare
There was a problem hiding this comment.
Pull request overview
Updates Go module dependencies to incorporate the oras-go v2.6.2 security patch (CVE-2026-50163 / GHSA-fxhp-mv3v-67qp) and aligns related module metadata in the repository’s Go dependency graph.
Changes:
- Bump
oras.land/oras-go/v2fromv2.6.1tov2.6.2(security patch release). - Update
golang.org/x/syncfromv0.21.0tov0.22.0as part of dependency resolution. - Promote
github.com/gardener/gardener-extension-provider-openstack v1.54.0from indirect to direct ingo.mod(it is imported directly in code).
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| go.mod | Updates direct module requirements to oras-go/v2 v2.6.2, x/sync v0.22.0, and corrects direct vs indirect classification for the OpenStack provider module. |
| go.sum | Refreshes checksums to match the updated module versions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
77fc3cb to
2c3802e
Compare
Merging this branch will decrease overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
2c3802e to
a86d465
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The changes are limited to dependency/version metadata and consistently update both go.mod and go.sum to the intended security-patched oras-go release.
Review details
- Files reviewed: 1/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
a86d465 to
d590bfd
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The changes are limited to dependency/version metadata updates and appear consistent with the module imports and updated checksums.
Review details
- Files reviewed: 1/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
This PR contains the following updates:
v2.6.1→v2.6.2oras-gotar extraction: Hardlink entry with relative Linkname escapes extract dir via process CWD resolutionCVE-2026-50163 / GHSA-fxhp-mv3v-67qp
More information
Details
Root cause
The tar-extraction helper
ensureLinkPathatcontent/file/utils.go:262-275validates that a hardlink's target resolves inside the extract base, but then returns the original unresolvedtargetstring back to the caller:The caller for
TypeLinkhardlinks then does:os.Link(oldname, newname)wraps thelink(2)system call. From thelink(2)man page:So when
target(i.e.,header.Linkname) is a relative path,os.Linkresolves it against the process's current working directory, not againstfilepath.Dir(link)as the validation assumed.Attack
An attacker who controls an OCI-compliant registry (or any artifact source the victim consumes via
oras pull) crafts a tarball layer with:payload.tar.gz/README.txt.Typeflag=TypeLink,Name=payload.tar.gz/evil_cwd_link,Linkname="victim.secret"(relative).and marks the layer descriptor with
io.deis.oras.content.unpack: "true"(a standard annotation that tellsoras-goto auto-extract).When a victim runs
oras pull(or any Go code usingcontent.File), the extraction:payload.tar.gz/evil_cwd_link— passes.ensureLinkPath(dirPath, "payload.tar.gz", filePath, "victim.secret"):path = filepath.Join(filepath.Dir(filePath), "victim.secret")=<extract_base>/payload.tar.gz/victim.secret→ inside base → validation passes.target = "victim.secret"(NOTpath).os.Link("victim.secret", "<extract_base>/payload.tar.gz/evil_cwd_link").link(2)resolves relativeoldname="victim.secret"against process CWD → creates a hardlink inside the extract tree pointing to<invoker_CWD>/victim.secret.The resulting hardlink and the CWD file share an inode — reading one reads the other; writing to one writes to the other.
Proof of Concept
Tested on Ubuntu 24.04.4 LTS with
orasCLI v1.3.0 (SHA-256040e140304b7dbdd9b40dacd798e2303cea44ad84eeb210750afdf15f1dcf8b4, downloaded from https://github.com/oras-project/oras/releases/download/v1.3.0/oras_1.3.0_linux_amd64.tar.gz).Reproduction script (standalone, ~50 lines) attached. Summary of key steps:
Observed output:
A library-level regression test is also provided (
poc_test.go) that drops intocontent/file/utils_test.goand runs viago test ./content/file/... -run TestPoC— output shows identical inode match for consumers of the library API.Impact
Primary: arbitrary-CWD-file read primitive. An attacker-controlled OCI artifact, when pulled by a victim using the
orasCLI or any Go program usingoras-go/v2/content/file, can create a hardlink inside the victim's extract tree pointing to an arbitrary file in the victim's process CWD (that the invoker UID is permitted to read). Reading the extract-tree hardlink yields that file's contents verbatim.Secondary: inode-sharing tampering primitive. Any tool that later modifies the extract-tree hardlink (write, chmod, truncate, etc.) modifies the CWD file through the shared inode. This violates the "writes inside the extract dir are confined" invariant that downstream tooling (CI systems, container-image builders, artifact scanners) typically depends on.
High-severity chains:
oras pullruns from a project workspace containing secrets/credentials (.env,.git/config, service-account tokens). The pulled artifact can hardlink those secrets into a location later archived/mounted/published.oras-goto fetch artifacts; their CWD is typically/or/root— very sensitive.oras-goto fetch and re-serve artifacts; each proxy process has a CWD with configuration, keys, or per-tenant state.Not affected:
oras push(tarball creation side):tarDirectoryin the same file explicitly skips hardlink generation (line 65 comment:"We don't support hard links and treat it as regular files"), so pushed content cannot trigger this on the server.TypeSymlink):os.Symlinkstores the target string verbatim and does not CWD-resolve at creation time. The currentensureLinkPathreturn-of-targetis correct for symlinks (the existing validation correctly models the symlink-follow path).Attack-surface boundary (
fs.protected_hardlinks)On Linux with
fs.protected_hardlinks=1(default on modern distros),link(2)additionally requires the linking user to have READ + WRITE permission on the source file (permay_linkat()in the kernel). Verified on Ubuntu 24.04: as non-root,ln /etc/passwd /tmp/xreturnsEPERM, and the same via the oras PoC path returnslink passwd /tmp/.../evil_passwd: operation not permitted.So the attacker cannot use this bug to read arbitrary root-owned files (e.g.,
/etc/shadow) when the victim invokesoras pullas a regular user. The attack surface depends on the invocation context:oras pullrun by a regular user.env,.git/config,.aws/credentials,~/.ssh/config, project-local secrets, CI workspace files.oras pullrun as root (systemd withoutUser=, container entrypoint default root, Kubernetes operator)/etc/shadow,/root/.ssh/id_rsa, bind-mounted host paths, service private keys.The user-context attack surface alone is sufficient for supply-chain-grade impact: CI pipelines and developer machines routinely hold API keys, signing keys, and cloud credentials in user-owned files in the working directory. The root-context escalation makes the bug Critical in mainstream Kubernetes/GitOps tooling where oras-go is adopted for artifact distribution.
Proposed fix
Change
ensureLinkPathto expose both the verbatim target (for symlinks) and the resolved absolute path (for hardlinks); have theTypeLinkcase use the resolved path.Regression test to add:
Extend
Test_extractTarDirectory_HardLinkwith a third sub-test that:t.TempDir()(or an explicitlyos.Chdir-entered directory) with a known name, e.g.sentinel.txt.TypeLinkentry withLinkname: "sentinel.txt"(relative).extractTarDirectoryreturned an error, OR the resulting hardlink's inode does NOT match the sentinel's inode.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
oras-gotar extraction: Hardlink entry with relative Linkname escapes extract dir via process CWD resolutionCVE-2026-50163 / GHSA-fxhp-mv3v-67qp / GO-2026-5880
More information
Details
Root cause
The tar-extraction helper
ensureLinkPathatcontent/file/utils.go:262-275validates that a hardlink's target resolves inside the extract base, but then returns the original unresolvedtargetstring back to the caller:The caller for
TypeLinkhardlinks then does:os.Link(oldname, newname)wraps thelink(2)system call. From thelink(2)man page:So when
target(i.e.,header.Linkname) is a relative path,os.Linkresolves it against the process's current working directory, not againstfilepath.Dir(link)as the validation assumed.Attack
An attacker who controls an OCI-compliant registry (or any artifact source the victim consumes via
oras pull) crafts a tarball layer with:payload.tar.gz/README.txt.Typeflag=TypeLink,Name=payload.tar.gz/evil_cwd_link,Linkname="victim.secret"(relative).and marks the layer descriptor with
io.deis.oras.content.unpack: "true"(a standard annotation that tellsoras-goto auto-extract).When a victim runs
oras pull(or any Go code usingcontent.File), the extraction:payload.tar.gz/evil_cwd_link— passes.ensureLinkPath(dirPath, "payload.tar.gz", filePath, "victim.secret"):path = filepath.Join(filepath.Dir(filePath), "victim.secret")=<extract_base>/payload.tar.gz/victim.secret→ inside base → validation passes.target = "victim.secret"(NOTpath).os.Link("victim.secret", "<extract_base>/payload.tar.gz/evil_cwd_link").link(2)resolves relativeoldname="victim.secret"against process CWD → creates a hardlink inside the extract tree pointing to<invoker_CWD>/victim.secret.The resulting hardlink and the CWD file share an inode — reading one reads the other; writing to one writes to the other.
Proof of Concept
Tested on Ubuntu 24.04.4 LTS with
orasCLI v1.3.0 (SHA-256040e140304b7dbdd9b40dacd798e2303cea44ad84eeb210750afdf15f1dcf8b4, downloaded from https://github.com/oras-project/oras/releases/download/v1.3.0/oras_1.3.0_linux_amd64.tar.gz).Reproduction script (standalone, ~50 lines) attached. Summary of key steps:
Observed output:
A library-level regression test is also provided (
poc_test.go) that drops intocontent/file/utils_test.goand runs viago test ./content/file/... -run TestPoC— output shows identical inode match for consumers of the library API.Impact
Primary: arbitrary-CWD-file read primitive. An attacker-controlled OCI artifact, when pulled by a victim using the
orasCLI or any Go program usingoras-go/v2/content/file, can create a hardlink inside the victim's extract tree pointing to an arbitrary file in the victim's process CWD (that the invoker UID is permitted to read). Reading the extract-tree hardlink yields that file's contents verbatim.Secondary: inode-sharing tampering primitive. Any tool that later modifies the extract-tree hardlink (write, chmod, truncate, etc.) modifies the CWD file through the shared inode. This violates the "writes inside the extract dir are confined" invariant that downstream tooling (CI systems, container-image builders, artifact scanners) typically depends on.
High-severity chains:
oras pullruns from a project workspace containing secrets/credentials (.env,.git/config, service-account tokens). The pulled artifact can hardlink those secrets into a location later archived/mounted/published.oras-goto fetch artifacts; their CWD is typically/or/root— very sensitive.oras-goto fetch and re-serve artifacts; each proxy process has a CWD with configuration, keys, or per-tenant state.Not affected:
oras push(tarball creation side):tarDirectoryin the same file explicitly skips hardlink generation (line 65 comment:"We don't support hard links and treat it as regular files"), so pushed content cannot trigger this on the server.TypeSymlink):os.Symlinkstores the target string verbatim and does not CWD-resolve at creation time. The currentensureLinkPathreturn-of-targetis correct for symlinks (the existing validation correctly models the symlink-follow path).Attack-surface boundary (
fs.protected_hardlinks)On Linux with
fs.protected_hardlinks=1(default on modern distros),link(2)additionally requires the linking user to have READ + WRITE permission on the source file (permay_linkat()in the kernel). Verified on Ubuntu 24.04: as non-root,ln /etc/passwd /tmp/xreturnsEPERM, and the same via the oras PoC path returnslink passwd /tmp/.../evil_passwd: operation not permitted.So the attacker cannot use this bug to read arbitrary root-owned files (e.g.,
/etc/shadow) when the victim invokesoras pullas a regular user. The attack surface depends on the invocation context:oras pullrun by a regular user.env,.git/config,.aws/credentials,~/.ssh/config, project-local secrets, CI workspace files.oras pullrun as root (systemd withoutUser=, container entrypoint default root, Kubernetes operator)/etc/shadow,/root/.ssh/id_rsa, bind-mounted host paths, service private keys.The user-context attack surface alone is sufficient for supply-chain-grade impact: CI pipelines and developer machines routinely hold API keys, signing keys, and cloud credentials in user-owned files in the working directory. The root-context escalation makes the bug Critical in mainstream Kubernetes/GitOps tooling where oras-go is adopted for artifact distribution.
Proposed fix
Change
ensureLinkPathto expose both the verbatim target (for symlinks) and the resolved absolute path (for hardlinks); have theTypeLinkcase use the resolved path.Regression test to add:
Extend
Test_extractTarDirectory_HardLinkwith a third sub-test that:t.TempDir()(or an explicitlyos.Chdir-entered directory) with a known name, e.g.sentinel.txt.TypeLinkentry withLinkname: "sentinel.txt"(relative).extractTarDirectoryreturned an error, OR the resulting hardlink's inode does NOT match the sentinel's inode.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Hardlink path traversal during tar extraction in oras.land/oras-go
CVE-2026-50163 / GHSA-fxhp-mv3v-67qp / GO-2026-5880
More information
Details
Hardlink path traversal during tar extraction in oras.land/oras-go
Severity
Unknown
References
This data is provided by OSV and the Go Vulnerability Database (CC-BY 4.0).
Release Notes
oras-project/oras-go (oras.land/oras-go/v2)
v2.6.2Compare Source
This is a security patch release addressing advisories in the content and remote layers, plus additional hardening and bug fixes since v2.6.1.
Security Fixes
TypeLink) target before passing it toos.Link, preventing a crafted OCI artifact from hardlinking a file outside the extraction directory via the process CWD (#1232, GHSA-fxhp-mv3v-67qp / CVE-2026-50163)Bug Fixes
content.ReadAllallocation by actual content read rather than the descriptor size, correcting the over-broad 32 MiB cap introduced for GHSA-f36w-mj3v-6jqv so legitimate in-memoryPush/FetchAll/FetchBytesare not rejected (#1223)Other Changes
golang.org/x/syncfrom 0.20.0 to 0.21.0 (#1208)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.