Improper Privilege Management Affecting nixos/nix package, versions [,2.18.0)[,2.19.0)[,2.20.0)[,2.21.0)[,2.22.0)[,2.23.0)


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.04% (12th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-NIXOSNIX-7411841
  • published28 Jun 2024
  • disclosed28 Jun 2024
  • creditUnknown

Introduced: 28 Jun 2024

CVE-2024-38531  (opens in a new tab)
CWE-278  (opens in a new tab)

How to fix?

Upgrade nixos/nix to version 2.18.0, 2.19.0, 2.20.0, 2.21.0, 2.22.0, 2.23.0 or higher.

Overview

Affected versions of this package are vulnerable to Improper Privilege Management through the build process. An attacker can escalate privileges and hijack all future builds by creating a setuid binary in a globally accessible location and assuming the permissions of a Nix daemon worker.

Notes:

The following conditions must be met:

  1. The local user has access to the Nix daemon.

  2. Seccomp is disabled, meaning that the sandbox is disabled or filter-syscalls if set to false on Linux, or seccomp is ineffective.

Workaround

  1. If Nix version is >= 2.22, set build-dir to a location that is only accessible by root( #10312 )

  2. Run your Nix daemon with $TMPDIR set to a location only accessible by root.

References

CVSS Scores

version 4.0
version 3.1