Summary
@nx/docker: OS command injection in the @nx/docker release pipeline
The @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.
Severity
Exploitable 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.
Affected & Patched Versions
| Package | Vulnerable | Patched |
|---|---|---|
@nx/docker |
>= 21.4.0, < 22.7.8; >= 23.0.0, < 23.1.1 |
22.7.8, 23.1.1 |
Every published @nx/docker release before the patched versions is affected.
[!IMPORTANT]--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.
Details
Several 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.
Credits
- Arkadiusz Marta (RE:SOURCE), Reporter
Impact
Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Upgrade to 22.7.8 (22.x line) or 23.1.1 (23.x line) or later:
nx migrate 23.1.1
The 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.
Frequently Asked Questions
- What is CVE-2026-104859? CVE-2026-104859 is a high-severity OS command injection vulnerability in @nx/docker (npm), affecting versions >= 21.4.0, < 22.7.8. It is fixed in 22.7.8, 23.1.1. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
- Which versions of @nx/docker are affected by CVE-2026-104859? @nx/docker (npm) versions >= 21.4.0, < 22.7.8 is affected.
- Is there a fix for CVE-2026-104859? Yes. CVE-2026-104859 is fixed in 22.7.8, 23.1.1. Upgrade to this version or later.
- Is CVE-2026-104859 exploitable, and should I be worried? Whether CVE-2026-104859 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-104859 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-104859?
- Upgrade
@nx/dockerto 22.7.8 or later - Upgrade
@nx/dockerto 23.1.1 or later
- Upgrade