What’s Vulnerable › Vulnerabilities
CVE-2021-27851: Local privilege escalation in GNU Guix via guix-daemon and '--keep-failed'
- Severity: medium (CVSS 5.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.3% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2021-04-26 · updated 2026-06-17
- Weakness: CWE-264
Description
A security vulnerability that can lead to local privilege escalation has been found in ’guix-daemon’. It affects multi-user setups in which ’guix-daemon’ runs locally. The attack consists in having an unprivileged user spawn a build process, for instance with `guix build`, that makes its build directory world-writable. The user then creates a hardlink to a root-owned file such as /etc/shadow in that build directory. If the user passed the --keep-failed option and the build eventually fails, the daemon changes ownership of the whole build tree, including the hardlink, to the user. At that point, the user has write access to the target file. Versions after and including v0.11.0-3298-g2608e40988, and versions prior to v1.2.0-75109-g94f0312546 are vulnerable.
Affected products
- GNU Guix guix-daemon: from 0.11.0 before 1.2.0 — fixed in 1.2.0
How to fix
Upgrade to a fixed version: GNU Guix guix-daemon 1.2.0. Check the vendor advisory for mitigations.
References
- https://bugs.gnu.org/47229
- https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/
- https://bugs.gnu.org/47229
- https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/
Get alerted when CVE-2021-27851 or the next vulnerability affects your stack