Описание
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.
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.
Отчет
A flaw was found in oras-go. The ensureLinkPath tar extraction helper validates that a hardlink's target resolves inside the extract base directory, but returns the original unresolved target string instead of the validated path. When os.Link() is called with a relative Linkname, it resolves against the process's current working directory (CWD), not the extract directory. An attacker controlling an OCI registry can craft a tarball layer with a malicious hardlink entry whose relative Linkname escapes the extract directory, creating a hardlink to arbitrary files in the victim's CWD. Exploitation requires the victim to run oras pull (or code using the oras-go file store) against an attacker-controlled registry with auto-extract enabled (io.deis.oras.content.unpack annotation set to true). In typical Red Hat deployments, container registries are curated and trusted, reducing the likelihood of exploitation. The resulting hardlink shares an inode with the target file, allowing the attacker to read its contents through the extracted archive.
Меры по смягчению последствий
Upgrade to oras-go v2.6.1 or later.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| Gatekeeper 3 | gatekeeper/gatekeeper-rhel9 | Fix deferred | ||
| Multicluster Global Hub | multicluster-globalhub/multicluster-globalhub-grafana-rhel9 | Fix deferred | ||
| OpenShift Service Mesh 3 | openshift-service-mesh/istio-rhel9-operator | Fix deferred | ||
| Red Hat OpenShift Container Platform 4 | openshift4/cnf-tests-rhel8 | Fix deferred | ||
| Red Hat OpenShift Container Platform 4 | openshift4/metallb-rhel8-operator | Fix deferred | ||
| Red Hat OpenShift Container Platform 4 | openshift4/metallb-rhel9-operator | Fix deferred | ||
| Red Hat OpenShift Container Platform 4 | openshift4/oc-mirror-plugin-rhel8 | Fix deferred | ||
| Red Hat OpenShift Container Platform 4 | openshift4/oc-mirror-plugin-rhel9 | Fix deferred | ||
| Red Hat OpenShift Container Platform 4 | openshift4/ose-ansible-operator | Fix deferred | ||
| Red Hat OpenShift Container Platform 4 | openshift4/ose-azure-cluster-api-controllers-rhel8 | Fix deferred |
Показывать по
Дополнительная информация
Статус:
EPSS
5.9 Medium
CVSS3
Связанные уязвимости
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.
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.
oras-go is a Go library for managing OCI artifacts. Prior to 2.6.2, en ...
`oras-go` tar extraction: Hardlink entry with relative Linkname escapes extract dir via process CWD resolution
EPSS
5.9 Medium
CVSS3