CVE-2021-27851

Local privilege escalation in GNU Guix via guix-daemon and '--keep-failed'

No CVSS score yet EPSS 0.33%

Published 26 Apr 2021 Updated 17 Sep 2024 CNA: certcc

Check your servers for CVE-2021-27851

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-27851 affects guix-daemon, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Exploitation

EPSS 0.33%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 28.6% of all scored CVEs. Scores of 2 Dec 2026.

Weakness

Affected products

As the CNA lists them.

ProductVersions
guix-daemon
affected from v0.11.0-3298-g2608e40988, before unspecified
affected before v1.2.0-75109-g94f0312546

Is my server affected?

Find the installed version of guix-daemon and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i guix-daemon
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-27851 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-27851

RHEL, Rocky, Alma, Fedora

rpm -q guix-daemon
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-27851

Alpine

apk list --installed | grep -i guix-daemon

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2021-27851
trivy image --scanners vuln IMAGE | grep CVE-2021-27851

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2021-27851 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.