# CVE-2021-27851: Local privilege escalation in GNU Guix via guix-daemon and '--keep-failed'

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.33%, higher than 28% of CVEs (2026-12-01)
- Published: 2021-04-26T15:35:28.989Z
- Modified: 2026-06-17T03:45:30.917Z
- Weaknesses: CWE-59, CWE-264
- Assigned by: certcc

## 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.

(As written by CVE List.)

## Affected

- GNU Guix guix-daemon: from v0.11.0-3298-g2608e40988 before unspecified; from unspecified before v1.2.0-75109-g94f0312546
- gnu guix: from 0.11.0 before 1.2.0

## Every score

- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`
- NVD: CVSS:2.0 2.1 Low `AV:L/AC:L/Au:N/C:N/I:P/A:N`

## References

- <https://guix.gnu.org/en/blog/2021/risk-of-local-privilege-escalation-via-guix-daemon/> (patch, vendor-advisory)
- <https://bugs.gnu.org/47229> (issue-tracking, mailing-list, patch, vendor-advisory)

## Sources

- CVE List: [CVE-2021-27851](https://www.cve.org/CVERecord?id=CVE-2021-27851), CVE Terms of Use, modified 2024-09-17
- NVD: [CVE-2021-27851](https://nvd.nist.gov/vuln/detail/CVE-2021-27851), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-27851 · Whole record: https://cve.day/CVE-2021-27851.json · Rebuilt by cve.day 2026-11-25T22:58:01.037Z
