{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "extracted_events": [
              {
                "introduced": "0"
              },
              {
                "last_affected": "3.11.0"
              },
              {
                "fixed": "3.11.0"
              }
            ],
            "source": [
              "AFFECTED_FIELD",
              "DESCRIPTION"
            ]
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "705e3639447b48b468c93303da382d80abeab23b"
            }
          ],
          "repo": "https://github.com/jeemok/better-npm-audit",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "VulnCheck",
    "cwe_ids": [
      "CWE-78"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/57xxx/CVE-2026-57998.json",
    "unresolved_ranges": [
      {
        "extracted_events": [
          {
            "introduced": "4.0.0-rc.2"
          },
          {
            "last_affected": "4.0.0-rc.2"
          }
        ],
        "source": "AFFECTED_FIELD"
      }
    ]
  },
  "details": "better-npm-audit through 3.11.0, and the 4.0.0-rc.2 prerelease, builds its npm audit command by interpolating the user-supplied --registry option into a command string in src/handlers/handleInput.ts without validation or quoting, then passes that string to child_process.exec() in index.ts, which spawns a shell. A registry value containing shell metacharacters such as a semicolon, pipe, or command substitution executes arbitrary operating system commands with the privileges of the process running the audit.",
  "id": "CVE-2026-57998",
  "modified": "2026-08-30T03:30:49.002538339Z",
  "published": "2026-08-22T12:26:30.536Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/57xxx/CVE-2026-57998.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-57998"
    },
    {
      "type": "ADVISORY",
      "url": "https://www.vulncheck.com/advisories/better-npm-audit-os-command-injection-via-registry-flag"
    },
    {
      "type": "REPORT",
      "url": "https://github.com/jeemok/better-npm-audit/issues/119"
    },
    {
      "type": "FIX",
      "url": "https://github.com/jeemok/better-npm-audit/pull/120"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/jeemok/better-npm-audit"
    },
    {
      "type": "ARTICLE",
      "url": "https://github.com/jeemok/better-npm-audit/blob/fd99a0f41ff4342b8a0a6fdbe5a17261de3d0544/index.ts#L34"
    },
    {
      "type": "ARTICLE",
      "url": "https://github.com/jeemok/better-npm-audit/blob/fd99a0f41ff4342b8a0a6fdbe5a17261de3d0544/src/handlers/handleInput.ts#L30-L37"
    }
  ],
  "schema_version": "1.9.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "better-npm-audit OS Command Injection via registry flag"
}