Skip to content
Memory corruption Write-up Advanced

Local privilege escalation in Lix and Nix

The Nix and Lix daemons contained buffer overflow vulnerabilities that let a local attacker who can talk to the daemon run arbitrary code as the daemon user, which is root in multi-user setups. Exploitation also required weakening ASLR to reach a full compromise.

discourse.nixos.org

Published on discourse.nixos.org

Announcements Security

The author, on discourse.nixos.org

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a buffer overflow in the daemon's handling of data from connecting clients, with the Lix variant described as an integer overflow.

Impact

A local user permitted to connect to the daemon could gain code execution as the daemon user (root in multi-user installs), though the text says ASLR weakening techniques are also required for a compromise.

What the attacker needed

Local access to the daemon; user allowed by allowed-users/trusted-users; ASLR weakening needed for compromise

The fix

The vulnerabilities were fixed in the listed Nix and Lix patch releases, and NixOS was patched to strengthen ASLR.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Nix and Lix are tools that build and install software packages, and a background service called the daemon does privileged work for normal users. A memory bug in that service meant a user who was allowed to talk to it could trick it into running their own code with the service's high privileges. The advisory notes that a separate protection, address randomisation, also had to be defeated for a real takeover.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.