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

Medium 5.5 Published Updated

Local attackers can escalate privileges to root by exploiting hardlink handling in guix-daemon when the --keep-failed option is used.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2021-27851?

CVE-2021-27851 is a medium-severity vulnerability in GNU Guix guix-daemon, published on 26 Apr 2021. It can only be exploited from the same machine or local network, with no action from the victim.

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

Weakness: CWE-59, CWE-264

Which versions are affected by CVE-2021-27851?

It affects 1 product.

Linux distribution packages (1)
guix openSUSE:TumbleweedAll versions1.3.0-1.8

Products include Gnu Guix.

How do I fix CVE-2021-27851?

Upgrade to a fixed version.

Is CVE-2021-27851 being exploited?

There is no known exploitation of CVE-2021-27851 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2021-27851, GHSA-c5fp-qrw2-8x2w, UBUNTU-CVE-2021-27851, openSUSE-SU-2024:10836-1.

Is CVE-2021-27851 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free