CVE-2024-45593 Nix affected by unsafe NAR unpacking

Critical 9.1 Published Updated

A malicious NAR archive can cause Nix to write files to arbitrary locations, potentially leading to code execution or privilege escalation when running as root.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-45593?

CVE-2024-45593 is a critical path traversal vulnerability in NixOS nix, published on 10 Sep 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

Nix is a package manager for Linux and other Unix systems. A bug in Nix 2.24 prior to 2.24.6 allows a substituter or malicious user to craft a NAR that, when unpacked by Nix, causes Nix to write to arbitrary file system locations to which the Nix process has access. This will be with root permissions when using the Nix daemon. This issue is fixed in Nix 2.24.6.

Weakness: CWE-22

Which versions are affected by CVE-2024-45593?

It affects 1 product.

Products include Nixos Nix.

How do I fix CVE-2024-45593?

Upgrade to a fixed version.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-45593 being exploited?

There is no known exploitation of CVE-2024-45593 in the wild and no public exploit code.

Sources

Also known as CVE-2024-45845, GHSA-h4vv-h3jq-v493, UBUNTU-CVE-2024-45593.

Is CVE-2024-45593 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free