CVE-2021-27851
NixOS vulnerability analysis and mitigation

Overview

A security vulnerability (CVE-2021-27851) was discovered in 'guix-daemon' that could lead to local privilege escalation. The vulnerability affects multi-user setups where 'guix-daemon' runs locally. It was discovered in March 2021 and affects versions after and including v0.11.0-3298-g2608e40988, and versions prior to v1.2.0-75109-g94f0312546 (GNU Bug Report).

Technical details

The vulnerability exists in the build process handling of guix-daemon. When a user initiates a build process with the '--keep-failed' option, they can make the build directory world-writable. An attacker can then create a hardlink within the build directory to a root-owned file from outside the build directory (such as '/etc/shadow'). If the build fails, the daemon changes ownership of the entire build tree, including the hardlink, to the user, effectively giving them write access to the target file (GNU Bug Report).

Impact

The vulnerability allows local users to gain unauthorized write access to root-owned files, potentially leading to complete system compromise through privilege escalation. The impact is particularly severe in multi-user environments where guix-daemon runs locally (GNU Bug Report).

Exploitability

The vulnerability is exploitable in multi-user setups where guix-daemon runs locally. While initially thought to be mitigated by Linux's 'protected hardlinks' feature, further investigation revealed that exploitation remains possible even with this protection enabled, though more difficult. The vulnerability requires local system access and the ability to execute guix build commands (GNU Bug Report).

Mitigation and workarounds

The fix involves adding a root-owned 'wrapper' directory containing the build directory and implementing a two-stage move process for failed builds. Users are recommended to upgrade their guix-daemon to commit 94f0312546 or later. On Guix System, this can be done by running 'guix pull' followed by 'guix system reconfigure' and restarting the daemon. For other distributions using systemd, users should run 'sudo --login guix pull' and restart the guix-daemon service (GNU Bug Report).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-84121CRITICAL9.6
  • NixOS logoNixOS
  • firefox-esr
NoYesSep 01, 2026
CVE-2026-84123HIGH8.8
  • NixOS logoNixOS
  • thunderbird
NoYesSep 01, 2026
CVE-2026-84125MEDIUM5.4
  • NixOS logoNixOS
  • firefox
NoYesSep 01, 2026
CVE-2026-84124MEDIUM5.4
  • NixOS logoNixOS
  • cpe:2.3:a:mozilla:firefox
NoYesSep 01, 2026
CVE-2026-84122MEDIUM5.4
  • NixOS logoNixOS
  • firefox-esr
NoYesSep 01, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management