CVE-2026-50163

oras-go: Hardlink entry with relative Linkname escapes extract dir via process CWD resolution in `oras-go` tar extraction

Published Jul 17, 2026 CVSS 3.1 · 7.1 High EPSS < 1% KEV · Not listed
Description
oras-go is a Go library for managing OCI artifacts. Prior to 2.6.2, ensureLinkPath in content/file/utils.go:262-275 validates a hardlink target relative to the extract base but returns the unresolved target, causing os.Link("victim.secret", "<extract_base>/payload.tar.gz/evil_cwd_link") to resolve header.Linkname against the process current working directory for a Typeflag=TypeLink entry such as Name=payload.tar.gz/evil_cwd_link and Linkname="victim.secret" with io.deis.oras.content.unpack: "true", which can expose or tamper with files such as .env, .git/config, .aws/credentials, and ~/.ssh/config. This issue is fixed in version 2.6.2.

Analysis

AI-generated

Technical impact

A flaw in the oras-go Go library allows an attacker to craft a tarball containing a malicious hardlink. When the tarball is extracted, the hardlink can be redirected to a file outside the intended extraction directory, specifically on the victim’s current working directory. This results in the reading of sensitive data, and if the extraction process runs with elevated privileges, the attacker could gain unauthorized access to critical system files. The flaw is a classic path‑traversal vulnerability (CWE‑22).

Affected Systems

The vulnerability affects any deployment that employs the oras‑go library for handling OCI artifacts. Versions prior to 2.6.2 are affected; any instance of oras‑go that processes tarballs may be vulnerable. Users should review the vendor’s advisory and upgrade to a fixed release as soon as it becomes available.

Risk and Exploitability

The CVSS score of 7.1 indicates high severity, and the EPSS score of <1% suggests a low probability of exploitation. Because the exploit requires an opportunity to supply a crafted tarball, the attack vector is likely local or remote, depending on whether the application using oras‑go is exposed to untrusted input. Failure to apply the patch could allow an attacker to read arbitrary files on the host, potentially escalating privileges if the process runs with elevated rights.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the oras‑go library to the latest patched version that addresses the hardlink handling flaw.
  • Ensure tarball extraction is performed in a sandboxed environment or with strict path validation to prevent hardlinks from pointing outside the target directory.
  • Configure the application to reject or strip hardlinks from tarballs before extraction.
  • Run the component with least privilege and enforce appropriate file system permissions.

Generated by OpenCVE AI on July 30, 2026 at 23:40 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-fxhp-mv3v-67qp `oras-go` tar extraction: Hardlink entry with relative Linkname escapes extract dir via process CWD resolution
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Oras-project
Oras-project oras-go
Vendors & Products Oras-project
Oras-project oras-go
Type Values Removed Values Added
Description A flaw was found in oras-go, a Go library used for managing OCI (Open Container Initiative) artifacts. An attacker can exploit this vulnerability by providing a specially crafted tarball containing a malicious hardlink. When this tarball is extracted, the hardlink can be manipulated to point to files outside the intended extraction location, specifically within the victim's current working directory. This allows an attacker to read sensitive information from the system, and in some cases, could lead to unauthorized access to critical system files if the component is operating with elevated privileges. oras-go is a Go library for managing OCI artifacts. Prior to 2.6.2, ensureLinkPath in content/file/utils.go:262-275 validates a hardlink target relative to the extract base but returns the unresolved target, causing os.Link("victim.secret", "<extract_base>/payload.tar.gz/evil_cwd_link") to resolve header.Linkname against the process current working directory for a Typeflag=TypeLink entry such as Name=payload.tar.gz/evil_cwd_link and Linkname="victim.secret" with io.deis.oras.content.unpack: "true", which can expose or tamper with files such as .env, .git/config, .aws/credentials, and ~/.ssh/config. This issue is fixed in version 2.6.2.
Title oras-go: Oras-go: Information disclosure and arbitrary file access via crafted tarball hardlinks oras-go: Hardlink entry with relative Linkname escapes extract dir via process CWD resolution in `oras-go` tar extraction
Weaknesses CWE-59
References
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N'}

cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N'}

Type Values Removed Values Added
Description A flaw was found in oras-go, a Go library used for managing OCI (Open Container Initiative) artifacts. An attacker can exploit this vulnerability by providing a specially crafted tarball containing a malicious hardlink. When this tarball is extracted, the hardlink can be manipulated to point to files outside the intended extraction location, specifically within the victim's current working directory. This allows an attacker to read sensitive information from the system, and in some cases, could lead to unauthorized access to critical system files if the component is operating with elevated privileges.
Title oras-go: Oras-go: Information disclosure and arbitrary file access via crafted tarball hardlinks
Weaknesses CWE-22
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N'}

threat_severity

Moderate

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 20, 2026, 3:01 PM
Reserved
Jun 3, 2026, 8:54 PM
Status
Deferred
Published
Jul 17, 2026, 8:17 PM
Modified
Oct 24, 2026, 8:10 PM
Severity
Moderate
Public date
Jul 1, 2026, 9:35 PM