Skip to content
Heist/ feed
Back to feed
Low

Nix allows macOS sandbox escape via built-in builders

Type: advisorySources: OSV

Nix is a package manager for Linux and other Unix systems. On macOS, built-in builders (such as `builtin:fetchurl`, exposed to users with `import `) were not executed in the macOS sandbox. Thus, these builders (which are running under the `nixbld*` users) had read access to world-readable paths and write access to world-writable paths outside of the sandbox. This issue is fixed in 2.18.9, 2.19.7, 2.20.9, 2.21.5, 2.22.4, 2.23.4, and 2.24.10. Note that sandboxing is not enabled by default on macOS. The Nix sandbox is not primarily intended as a security mechanism, but as an aid to improve reproducibility and purity of Nix builds. However, sandboxing *can* mitigate the impact of other security issues by limiting what parts of the host system a build has access to.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-51481
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 17:11 UTC · Revision 1

Source evidence

Nix allows macOS sandbox escape via built-in builders

core-osv · Original source

Published 31 Oct 2024, 16:10 UTC

Nix is a package manager for Linux and other Unix systems. On macOS, built-in builders (such as `builtin:fetchurl`, exposed to users with `import `) were not executed in the macOS sandbox. Thus, these builders (which are running under the `nixbld*` users) had read access to world-readable paths and write access to world-writable paths outside of the sandbox. This issue is fixed in 2.18.9, 2.19.7, 2.20.9, 2.21.5, 2.22.4, 2.23.4, and 2.24.10. Note that sandboxing is not enabled by default on macOS. The Nix sandbox is not primarily intended as a security mechanism, but as an aid to improve reproducibility and purity of Nix builds. However, sandboxing *can* mitigate the impact of other security issues by limiting what parts of the host system a build has access to.

osv:CVE-2024-51481
Complete source record
{
  "id": "8b49f741dc7261ad108b15904b94d18659c0f0e39b595efd64bf63ac044b892c",
  "url": "https://osv.dev/vulnerability/CVE-2024-51481",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Nix allows macOS sandbox escape via built-in builders",
    "summary": "Nix is a package manager for Linux and other Unix systems. On macOS, built-in builders (such as `builtin:fetchurl`, exposed to users with `import `) were not executed in the macOS sandbox. Thus, these builders (which are running under the `nixbld*` users) had read access to world-readable paths and write access to world-writable paths outside of the sandbox. This issue is fixed in 2.18.9, 2.19.7, 2.20.9, 2.21.5, 2.22.4, 2.23.4, and 2.24.10. Note that sandboxing is not enabled by default on macOS. The Nix sandbox is not primarily intended as a security mechanism, but as an aid to improve reproducibility and purity of Nix builds. However, sandboxing *can* mitigate the impact of other security issues by limiting what parts of the host system a build has access to.",
    "evidence": "osv:CVE-2024-51481",
    "products": [],
    "severity": "low",
    "structured": {
      "id": "CVE-2024-51481",
      "aliases": [
        "CVE-2024-51481",
        "GHSA-wf4c-57rh-9pjg"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/nixos/nix",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "0f665ff6779454f2117dcc32e44380cda7f45523"
                },
                {
                  "introduced": "16e1ff3bcb5e785cce6bff8d0745e2a73fbd99de"
                },
                {
                  "fixed": "d9775222fbfa7e5d8ce1f722ea2968ff840324b4"
                },
                {
                  "introduced": "34807c8906a61219ec2e9132c9cf0bd4d29e1d12"
                },
                {
                  "fixed": "3824dfde1a42d0ecea4174dbcc4059d889a57f14"
                },
                {
                  "introduced": "5fd799cfa70d22a625bc706a599b6244f654718d"
                },
                {
                  "fixed": "750db54bfc0fe1c4ae20af98f537c8607e25368c"
                },
                {
                  "introduced": "ba36959311e09bd798f7029c41e108d9d77c9ac0"
                },
                {
                  "fixed": "d01638028ac60645ffeb721340fd25ac8f8269bc"
                },
                {
                  "introduced": "206e32e2d7c72c940a4348648f5de46122c495c9"
                },
                {
                  "fixed": "597fcc98e18e3178734d06a9e7306250e8cb8d74"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.18.9"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "2.20.0"
                      },
                      {
                        "fixed": "2.20.9"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "2.21.0"
                      },
                      {
                        "fixed": "2.21.5"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "2.22.0"
                      },
                      {
                        "fixed": "2.22.4"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "2.23.0"
                      },
                      {
                        "fixed": "2.23.4"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "2.24.0"
                      },
                      {
                        "fixed": "2.24.10"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "597fcc98e18e3178734d06a9e7306250e8cb8d74"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.24.9",
            "2.18.8",
            "2.24.8",
            "2.24.7",
            "2.18.7",
            "2.18.6",
            "2.24.6",
            "2.24.5",
            "2.24.4",
            "2.24.3",
            "2.24.2",
            "2.24.1",
            "2.24.0",
            "2.21.4",
            "2.20.8",
            "2.18.5",
            "2.23.3",
            "2.22.3",
            "2.23.2",
            "2.23.1",
            "2.22.2",
            "2.18.4",
            "2.20.7",
            "2.21.3",
            "2.18.3",
            "2.23.0",
            "2.22.1",
            "2.22.0",
            "2.20.6",
            "2.21.2",
            "2.21.1",
            "2.21.0",
            "2.20.5",
            "2.18.2",
            "2.20.4",
            "2.20.3",
            "2.20.2",
            "2.20.1",
            "2.20.0",
            "2.18.1",
            "2.18.0",
            "2.2",
            "2.0",
            "1.11.1",
            "1.11",
            "1.10",
            "1.9",
            "1.8",
            "1.7",
            "1.6.1",
            "1.6",
            "1.5.3",
            "1.5.2",
            "1.5.1",
            "1.5",
            "1.4",
            "1.3",
            "1.2",
            "1.1",
            "1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-51481.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:38.051714167Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/51xxx/CVE-2024-51481.json",
        "https://github.com/NixOS/nix/security/advisories/GHSA-wf4c-57rh-9pjg",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-51481",
        "https://github.com/NixOS/nix/commit/597fcc98e18e3178734d06a9e7306250e8cb8d74"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-693"
        ],
        "cna_assigner": "GitHub_M",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": ">= 2.19.0, < 2.19.7, 2.20.9, 2.21.5, 2.22.4, 2.23.4, 2.24.10"
                  },
                  {
                    "last_affected": ">= 2.19.0, < 2.19.7, 2.20.9, 2.21.5, 2.22.4, 2.23.4, 2.24.10"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandaloneSingleVersion"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/51xxx/CVE-2024-51481.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-51481",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 505171,
  "published_at": "2024-10-31T16:10:22.398+00:00"
}