Every CVE Search/ Get API key

RUSTSEC-2026-0450

`ocipkg`: unpacking an OCI archive can write and delete files outside the local image store (path traversal)

7.1 HighFix available

When ocipkg unpacks an OCI archive, the destination directory is derived from the image name, which ocipkg reads from the archive's own index.json (org.opencontainers.image.ref.name). That name is attacker-controlled, and ImageName::parse accepts a hostname of .., so the computed destination escapes the local image store. A "zip-slip"-style path traversal (CWE-22 / CWE-23). This is esclatable to code execution.

In Artifact::unpack (src/image/artifact.rs), the destination is image_dir(name) = data_dir().join(name.as_path()) (src/local/mod.rs:31), where the name comes from get_name_from_index (src/image/layout.rs:114-124):

let image_name = self.base.get_name()?;   // from the archive's index.json ref.name
let dest = image_dir(&image_name)?;        // data_dir().join(name.as_path()); hostname ".." escapes
if dest.exists() {
    if overwrite {
        fs::remove_dir_all(&dest)?;        // deletes a directory OUTSIDE the store
    }
}
fs::create_dir_all(&dest)?;
// ... each tar layer is then unpacked under `dest` (also outside the store)

The fix

Fixed in ocipkg 0.4.1 by PR #223. The leading reference component is validated against the org.opencontainers.image.ref.name grammar from OCI Image Specification 1.1.1 on parse and deserialization, and local::image_dir revalidates the name and rejects any non-normal path component (e.g. ..) before any filesystem mutation, so a crafted archive can no longer escape the local image store.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
None
Integrity
High
Availability
High

What each source reports

OSV Score used 7.1

`ocipkg`: unpacking an OCI archive can write and delete files outside the local image store (path traversal)

When ocipkg unpacks an OCI archive, the destination directory is derived from the image name, which ocipkg reads from the archive's own index.json (org.opencontainers.image.ref.name). That name is attacker-controlled, and ImageName::parse accepts a hostname of .., so the computed destination escapes the local image store. A "zip-slip"-style path traversal (CWE-22 / CWE-23). This is esclatable to code execution.

In Artifact::unpack (src/image/artifact.rs), the destination is image_dir(name) = data_dir().join(name.as_path()) (src/local/mod.rs:31), where the name comes from get_name_from_index (src/image/layout.rs:114-124):

let image_name = self.base.get_name()?;   // from the archive's index.json ref.name
let dest = image_dir(&image_name)?;        // data_dir().join(name.as_path()); hostname ".." escapes
if dest.exists() {
    if overwrite {
        fs::remove_dir_all(&dest)?;        // deletes a directory OUTSIDE the store
    }
}
fs::create_dir_all(&dest)?;
// ... each tar layer is then unpacked under `dest` (also outside the store)

The fix

Fixed in ocipkg 0.4.1 by PR #223. The leading reference component is validated against the org.opencontainers.image.ref.name grammar from OCI Image Specification 1.1.1 on parse and deserialization, and local::image_dir revalidates the name and rejects any non-normal path component (e.g. ..) before any filesystem mutation, so a crafted archive can no longer escape the local image store.

Record
RUSTSEC-2026-0450
CVSS 3.1
7.1 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
Updated
2026-11-06

Affected packages

Affected packages
PackageAffectedFixed
ocipkg
crates.io
0.0.0-0 up to 0.4.1
0.4.1

History

History
RecordedChangedSources
first indexedOSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

RUSTSEC-2026-0450 is a high vulnerability (CVSS 7.1) in ocipkg, published October 30, 2026. No source lists public exploit code. Fixed in ocipkg 0.4.1.

References

MoveEnter Open