{"answers":{"affected":"4 open source packages ship an affected version, including nx.","exploited":"There is no known exploitation of GHSA-w2vw-w76x-qr89 in the wild and no public exploit code.","fix":"Upgrade nx to a fixed version for your release line: 22.7.8 or 23.1.1.","what":"GHSA-w2vw-w76x-qr89 is a command injection vulnerability in nx, published on 5 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-w2vw-w76x-qr89 and fix it if it is affected.\n\nWhat it is: GHSA-w2vw-w76x-qr89 is a command injection vulnerability in nx, published on 5 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-w2vw-w76x-qr89 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- nx (npm): affected from 14.0.0; fixed in 22.7.8\n- nx (npm): affected from 14.0.0; fixed in 22.7.8\n- nx (npm): affected from 23.0.0; fixed in 23.1.1\n- nx (npm): affected from 23.0.0; fixed in 23.1.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-w2vw-w76x-qr89/ (Markdown: https://insights.sbomify.com/GHSA-w2vw-w76x-qr89/index.md)","id":"GHSA-w2vw-w76x-qr89","markdown":"https://insights.sbomify.com/GHSA-w2vw-w76x-qr89/index.md","name":"GHSA-w2vw-w76x-qr89","record":{"aliases":[],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Nx build system","requires_auth":"none","summary":"Attackers can execute arbitrary commands on developer machines and CI runners by controlling git revisions or remote refs in Nx projects.","user_interaction":"required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## Summary\n\nNx core builds several `git` invocations as shell command strings with untrusted values interpolated into them, so a value that should be a git revision or ref is parsed by `/bin/sh` instead. Two entry points are reachable by an attacker: `affected` commands, where `defaultBase` / `affected.defaultBase` from `nx.json` (and the `NX_BASE` / `NX_HEAD` environment variables) reach `git merge-base` and `git diff`; and `nx import`, where a branch name advertised by a remote repository reaches `git fetch`, `git checkout`, and `git config`. In both cases an attacker who controls a repository — or who opens a pull request against one — gets arbitrary command execution on the machine of anyone who runs an ordinary Nx command against it, including CI runners.\n\nThe `affected` path is the more serious of the two. `nx affected` and `nx show projects --affected` run constantly in CI, so a pull request that changes nothing but `nx.json` is enough to execute code on the runner with whatever credentials that job holds.\n\n## Severity\n\nExploitable by anyone who controls repository content — a fork's pull request, or a repository the victim clones — that the victim then runs an ordinary `nx affected` or `nx import` against; no access to the victim's machine is required. We have no evidence of exploitation in the wild.\n\n## Affected \u0026 Patched Versions\n\n| Package | Vulnerable | Patched |\n| --- | --- | --- |\n| `nx` | `\u003e= 14.0.0, \u003c 22.7.8`; `\u003e= 23.0.0, \u003c 23.1.1` | `22.7.8`, `23.1.1` |\n\nTreat every version below the patched ones as affected.\n\n## Remediation\n\nUpgrade to **22.7.8** (22.x line) or **23.1.1** (23.x line) or later:\n\n```\nnx migrate 23.1.1\n```\n\nThe fix is a drop-in — no configuration changes are required. If you cannot upgrade, treat `nx.json` from untrusted sources as executable content, do not run `affected` commands against pull requests you have not reviewed, and do not run `nx import` against repositories you do not trust.\n\n## Details\n\n### `affected` commands\n\nNx computes the merge base and the changed-file set by building `git merge-base` and `git diff` command lines as strings and running them through a shell. The base and head revisions in those strings come from `nx.json`'s `defaultBase` / `affected.defaultBase` or from the `NX_BASE` / `NX_HEAD` environment variables, and a related code path reads file contents with `git show \u003crevision\u003e:\u003cpath\u003e` the same way. Because a shell parses the whole line, a revision value containing shell syntax is executed rather than passed to `git`.\n\nThe revisions are wrapped in double quotes, which looks protective but is not: POSIX shells still perform command substitution inside double quotes, so a value of `$(…)` runs without needing to break out of the quotes.\n\n### `nx import`\n\nThe `GitRepository` helper runs every git operation — `fetch`, `checkout`, `reset`, `config`, and others — by interpolating its arguments into a shell command string. The untrusted argument is a branch name: `nx import` lists the branches a remote advertises, offers them to the user to choose from, and feeds the chosen name back into those commands. A hostile repository controls the names of its own branches, so it controls the command that runs when one is selected.\n\n## Credits\n\n- **Arkadiusz Marta** (RE:SOURCE) — Reporter","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Nx: OS command injection via git revisions and remote refs","id":"GHSA-w2vw-w76x-qr89","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"command_injection","year":"2026"},"n_packages":4,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["22.7.8"],"introduced":["14.0.0"],"last_affected":[],"package":"nx","purl":null,"source":"GHSA-w2vw-w76x-qr89"},{"ecosystem":"npm","fixed":["22.7.8"],"introduced":["14.0.0"],"last_affected":[],"package":"nx","purl":"pkg:npm/nx","source":"GHSA-w2vw-w76x-qr89"},{"ecosystem":"npm","fixed":["23.1.1"],"introduced":["23.0.0"],"last_affected":[],"package":"nx","purl":null,"source":"GHSA-w2vw-w76x-qr89"},{"ecosystem":"npm","fixed":["23.1.1"],"introduced":["23.0.0"],"last_affected":[],"package":"nx","purl":"pkg:npm/nx","source":"GHSA-w2vw-w76x-qr89"}],"products":null,"published":"2026-10-05","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can execute arbitrary commands on developer machines and CI runners by controlling git revisions or remote refs in Nx projects.","url":"https://insights.sbomify.com/GHSA-w2vw-w76x-qr89/"}