Nx: OS command injection via git revisions and remote refs
## Summary Nx 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. The `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. ## Severity Exploitable 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. ## Affected & Patched Versions | Package | Vulnerable | Patched | | --- | --- | --- | | `nx` | `>= 14.0.0, < 22.7.8`; `>= 23.0.0, < 23.1.1` | `22.7.8`, `23.1.1` | Treat every
GHSA-w2vw-w76x-qr89
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:GHSA-w2vw-w76x-qr89
nx
Source reference: /affected/0/package/name
- Affected versions
- Not stated in this record
- Fixed versions
- 22.7.8
Source reference:
/affected/0/ranges - Prerequisites
- Not stated in this record
nx
Source reference: /affected/1/package/name
- Affected versions
- Not stated in this record
- Fixed versions
- 23.1.1
Source reference:
/affected/1/ranges - Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "14.0.0"
},
{
"fixed": "22.7.8"
}
]
}
],
"package": {
"name": "nx",
"purl": "pkg:npm/nx",
"ecosystem": "npm"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-w2vw-w76x-qr89/GHSA-w2vw-w76x-qr89.json"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "23.0.0"
},
{
"fixed": "23.1.1"
}
]
}
],
"package": {
"name": "nx",
"purl": "pkg:npm/nx",
"ecosystem": "npm"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-w2vw-w76x-qr89/GHSA-w2vw-w76x-qr89.json"
}
}
]Publisher severity
high
Source reference: /database_specific/severity
- Event
- #85936 · Revision 1
- Added to Heist Feed
- Publisher date