Vulnerability RUSTSEC-2026-0425

High Risk
HIGH RISK
CVSS Score: 7.5
Score Range: 7.0–8.9
High severity vulnerabilities (CVSS 7.0–8.9). Serious vulnerabilities that should be prioritized soon after critical fixes.
15 hours ago
October 30, 2026 at 12:00 PM UTC
`nix-nar`: `Decoder::unpack` writes archive entries outside the destination directory (path traversal)
0.1.0 - 0.5.0
0.1.0 - 0.5.0

Summary

`nix-nar`: `Decoder::unpack` writes archive entries outside the destination directory (path traversal)

Details

Decoder::unpack does not safely contain the paths it extracts, so a malicious NAR archive can create files outside the destination directory — a path traversal (CWE-22).

In src/dec.rs (Decoder::unpack):

  • A symlink entry's target is written without checking where it points (src/dec.rs:153), so the archive can create a symlink that escapes the destination directory.
  • The out-of-destination containment check compares path strings only and does not account for symlinks created earlier in the same unpack (src/dec.rs:176-181), before reaching the write sinks (std::fs::create_dir at src/dec.rs:201 and OpenOptions::open at src/dec.rs:218).
  • The parser also accepts entry names containing / (src/parser.rs:138-147).

Combined, a malicious archive can include a symlink a pointing at an external directory and then an entry named a/b, causing b to be written to <external>/b, outside the destination. This can create new files anywhere the process can write (it cannot overwrite existing files), which is escalatable to code execution by planting files in attacker-chosen locations.

Impacted packages

Timeline

Published
15 hours ago
October 30, 2026 at 12:00 PM UTC
Fixed (0.6.0)
17 days ago
October 13, 2026 at 12:39 PM UTC
Last Modified
17 hours ago
October 30, 2026 at 10:45 AM UTC