CVE-2025-52993

5.6 MEDIUM

📋 TL;DR

A race condition vulnerability in Nix, Lix, and Guix package managers allows attackers to change ownership of arbitrary files to the build user's UID/GID. This affects users running vulnerable versions of these package managers, potentially enabling privilege escalation. The vulnerability stems from improper synchronization during file operations.

💻 Affected Systems

Products:
  • Nix
  • Lix
  • Guix
Versions: Nix before 2.24.15, 2.26.4, 2.28.4, and 2.29.1; Lix before 2.91.2, 2.92.2, and 2.93.1; Guix before 1.4.0-38.0e79d5b
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all default installations of vulnerable versions. Build users (nixbld*, guixbuild*) must be present on the system.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise through privilege escalation to root, allowing attackers to modify critical system files, install backdoors, or access sensitive data.

🟠

Likely Case

Local privilege escalation allowing attackers to gain build user privileges and potentially modify files owned by that user, leading to further exploitation.

🟢

If Mitigated

Limited impact if build users have minimal privileges and file permissions are properly configured, though arbitrary file ownership changes remain possible.

🌐 Internet-Facing: LOW - This is primarily a local privilege escalation vulnerability requiring access to the system.
🏢 Internal Only: MEDIUM - Internal users with shell access could exploit this to escalate privileges, particularly in multi-user environments or build servers.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires local access and knowledge of race condition timing. No public exploit code has been released as of the advisory dates.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Nix 2.24.15, 2.26.4, 2.28.4, 2.29.1 or later; Lix 2.91.2, 2.92.2, 2.93.1 or later; Guix 1.4.0-38.0e79d5b or later

Vendor Advisory: https://discourse.nixos.org/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/66017

Restart Required: No

Instructions:

1. Update Nix: nix-env --upgrade; 2. Update Lix: lix upgrade; 3. Update Guix: guix pull && guix package -u

🔧 Temporary Workarounds

Restrict build user privileges

linux

Limit the capabilities and file access of nixbld* and guixbuild* users to reduce impact if exploited

sudo chmod 700 /nix/store
sudo setfacl -m u:nixbld:r-x /nix/store

Isolate build environments

linux

Run package builds in isolated containers or VMs to contain potential privilege escalation

docker run --rm -v /nix:/nix nixos/nix nix-build

🧯 If You Can't Patch

  • Restrict shell access to users who don't need package manager privileges
  • Monitor file ownership changes in /nix/store and other package manager directories

🔍 How to Verify

Check if Vulnerable:

Check package manager version: nix --version, lix --version, or guix --version and compare against patched versions

Check Version:

nix --version 2>/dev/null || lix --version 2>/dev/null || guix --version 2>/dev/null

Verify Fix Applied:

Verify version is at or above patched versions and test basic package operations work correctly

📡 Detection & Monitoring

Log Indicators:

  • Unexpected file ownership changes in /nix/store or package directories
  • Multiple rapid file operations by build users
  • Failed privilege escalation attempts

Network Indicators:

  • None - this is a local vulnerability

SIEM Query:

source=*audit* (event_type=chown OR event_type=setxattr) AND user=nixbld*

🔗 References

📤 Share & Export