Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

RUSTSEC-2026-0450

UNSCORED

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

Mitigation

  • Upgrade ocipkg to 0.4.1 or later.

Who should check

  • Projects that depend on crates.io package ocipkg (>= 0.0.0-0, < 0.4.1)

Vulnerability facts

Affected
ocipkg >= 0.0.0-0, < 0.4.1
Fixed in
0.4.1
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Unknown
CVSS
Not scored yet
Published
Modified

Description

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`): ```rust 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](https://github.com/termoshtt/ocipkg/pull/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.

Affected and fixed versions

Package / productAffectedFixedSource
crates.io ocipkg>= 0.0.0-0, < 0.4.10.4.1osv

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by RUSTSEC-2026-0450. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/RUSTSEC-2026-0450.md
Affected: ocipkg >= 0.0.0-0, < 0.4.1
Fixed in: 0.4.1

Steps:
1. Search this machine and project for ocipkg (crates.io): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is RUSTSEC-2026-0450 being exploited?

There is no confirmed exploitation: RUSTSEC-2026-0450 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

How serious is RUSTSEC-2026-0450?

It has no CVSS score yet. Unknown.

Which versions are affected by RUSTSEC-2026-0450?

ocipkg >= 0.0.0-0, < 0.4.1.

Is there a fix for RUSTSEC-2026-0450?

Yes. Fixed in 0.4.1. Upgrade ocipkg to 0.4.1 or later.

How do I check if I'm affected by RUSTSEC-2026-0450?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors