nix-nar
Affected
- introduced
0.0.0-0, fixed0.6.0(semver)
Fixed versions
0.6.0
Fix
- Fixed version
0.6.0cargo update -p nix-nar --precise 0.6.0
Advisory
Also known as: None
nix-nar: Decoder::unpack writes archive entries outside the destination directory (path traversal)
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):
src/dec.rs:153), so the archive can create a symlink that escapes the destination directory.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)./ (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.
High Basis: CVSS v3 score 7.5, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
0.0.0-0, fixed 0.6.0 (semver)0.6.0
0.6.0cargo update -p nix-nar --precise 0.6.0Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: RustSec Advisory Database · CC0-1.0