Skip to main content
VulnerabilityPublished

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

Affects nix-narSource GCVE Database

0

CVSS 7.5 High : upgrade to 0.6.0 soon.

Data as of 30 Oct 2026, 11:15 UTC

CVSS 3.1 base score
7.5High
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 0.6.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

What to do

Upgrade nix-nar to 0.6.0.

Affected software

ProductAffectedFixed in
crates.ionix-narpkg:cargo/nix-narOther threatsAffected
  • >=0.0.0-0 <0.6.0
Fixed in
  • 0.6.0

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A fix is available in `nix-nar` version 0.6.0. Users should upgrade to version 0.6.0 or later to mitigate this path traversal vulnerability. No additional mitigation steps are required if the upgrade is applied.

Description

The `nix-nar` crate's `Decoder::unpack` function improperly handles path containment when extracting archive entries, allowing a malicious NAR archive to write files outside the intended destination directory via path traversal. This occurs because symlink targets are not validated and the containment check only compares path strings without considering symlinks created earlier during unpacking. An attacker can craft an archive that creates symlinks pointing outside the destination and then writes files through these symlinks, potentially enabling code execution by placing files in attacker-controlled locations.

References

Community reviews

Loading reviews…