{"id":"CVE-2026-104859","aliases":["CVE-2026-104859","GHSA-6vc5-vf29-ffr2"],"related":[],"kind":"vulnerability","state":"published","title":"Nx: OS command injection in the @nx/docker release pipeline","summary":"Nx is a monorepo solution for TypeScript and polyglot codebases. From 21.4.0 until 22.7.8 and from 23.0.0 until 23.1.1, the @nx/docker release pipeline builds docker tag, image lookup, and docker push invocations as shell command strings. The release.docker.repositoryName and registryUrl configuration values are interpolated into those strings and passed to /bin/sh -c, allowing shell syntax in untrusted Nx configuration to execute during nx release version or nx release publish. A pull request or repository configuration change can therefore execute commands with the release job's privileges and expose registry credentials or cloud tokens, and dry-run publishing does not prevent the vulnerable pre-check command from executing. This issue is fixed in versions 22.7.8 and 23.1.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Nx is a monorepo solution for TypeScript and polyglot codebases. From 21.4.0 until 22.7.8 and from 23.0.0 until 23.1.1, the @nx/docker release pipeline builds docker tag, image lookup, and docker push invocations as shell command strings. The release.docker.repositoryName and registryUrl configuration values are interpolated into those strings and passed to /bin/sh -c, allowing shell syntax in untrusted Nx configuration to execute during nx release version or nx release publish. A pull request or repository configuration change can therefore execute commands with the release job's privileges and expose registry credentials or cloud tokens, and dry-run publishing does not prevent the vulnerable pre-check command from executing. This issue is fixed in versions 22.7.8 and 23.1.1.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe `@nx/docker` release pipeline builds its `docker` invocations as shell command strings, interpolating `release.docker.repositoryName` and `registryUrl` from Nx configuration into them. Because those strings are handed to `/bin/sh -c`, a crafted repository or registry name executes as a command during `nx release version` and `nx release publish`. Anyone running a Docker release against a repository whose Nx configuration they do not control — or whose configuration a pull request has changed — executes the injected command with the privileges of the release job, which in CI typically holds registry credentials and cloud tokens.\n\n## Severity\n\nExploitable when someone runs a Docker release against attacker-supplied configuration, with high impact because release jobs hold publishing credentials. There is no known evidence of exploitation in the wild.\n\n## Affected & Patched Versions\n\n| Package | Vulnerable | Patched |\n| --- | --- | --- |\n| `@nx/docker` | `>= 21.4.0, < 22.7.8`; `>= 23.0.0, < 23.1.1` | `22.7.8`, `23.1.1` |\n\nEvery published `@nx/docker` release before the patched versions is affected.\n\n> [!IMPORTANT]\n> `--dry-run` does not protect you: one of the injected commands runs before the dry-run check, so even a dry-run publish reaches a shell.\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 and requires no configuration change. If you have run `nx release version` with a configuration you do not trust, delete the generated Docker version file before your next publish, since the composed reference is read back from disk.\n\n## Details\n\nSeveral `docker` commands in the release pipeline (`docker tag` during `nx release version`; the image existence check and `docker push` during `nx release publish`) are built as shell command strings with the image reference interpolated in. The reference is composed from the project's `release.docker` `repositoryName` and `registryUrl`, so a value containing shell syntax is executed rather than passed to `docker`.\n \n\n## Credits\n\n- **Arkadiusz Marta** (RE:SOURCE) — Reporter","format":"markdown","source":"ghsa"}],"published":"2026-10-02T17:49:37.975Z","modified":"2026-10-05T23:45:08.226Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":7.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":7.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":">= 21.4.0, < 22.7.8","status":"affected"},{"version":">= 23.0.0, < 23.1.1","status":"affected"}],"vendor":"nrwl","product":"nx","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"21.4.0","status":"affected","fixed":"22.7.8"}],"ecosystem":"npm","package":"@nx/docker","purl":"pkg:npm/%40nx/docker","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"23.0.0","status":"affected","fixed":"23.1.1"}],"ecosystem":"npm","package":"@nx/docker","purl":"pkg:npm/%40nx/docker","source":"ghsa"}],"references":[{"url":"https://github.com/nrwl/nx/security/advisories/GHSA-6vc5-vf29-ffr2","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nrwl/nx/pull/36505","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nrwl/nx/commit/6d60eed061f050e0d5af509a1f5a07c707f09865","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nrwl/nx/commit/b587441fd8da28c5db37edb0826554e0060dc81b","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-104859","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nrwl/nx","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-05T20:08:54.062Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-104859","url":"https://www.cve.org/CVERecord?id=CVE-2026-104859","licence":"CVE Terms of Use","modified":"2026-10-05T20:09:01.291Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6vc5-vf29-ffr2","url":"https://github.com/advisories/GHSA-6vc5-vf29-ffr2","licence":"CC-BY-4.0","modified":"2026-10-05T23:45:08.226Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-104859","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-104859","licence":"Public domain","modified":"2026-10-05T21:16:32.897Z"}],"updatedAt":"2026-11-25T22:59:41.996Z","epss":{"score":0.00148,"percentile":0.04248,"date":"2026-12-01T12:00:22.000Z"}}