# CVE-2026-104859: Nx: OS command injection in the @nx/docker release pipeline

> Attackers can execute arbitrary OS commands via malicious configuration in Nx release pipelines, potentially exposing credentials and compromising the release environment.

- **Severity:** High 7.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 2 Oct 2026
- **Updated:** 5 Oct 2026
- **Also known as:** GHSA-6vc5-vf29-ffr2

## What is CVE-2026-104859?

CVE-2026-104859 is a high-severity command injection vulnerability in nrwl nx, published on 2 Oct 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2026-104859?

4 open source packages ship an affected version, including @nx/docker.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@nx/docker` | npm | From 21.4.0 | 22.7.8 |
| `@nx/docker` | npm | From 21.4.0 | 22.7.8 |
| `@nx/docker` | npm | From 23.0.0 | 23.1.1 |
| `@nx/docker` | npm | From 23.0.0 | 23.1.1 |

## How do I fix CVE-2026-104859?

Upgrade @nx/docker to a fixed version for your release line: 22.7.8 or 23.1.1.

## Is CVE-2026-104859 being exploited?

There is no known exploitation of CVE-2026-104859 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-104859 and fix it if it is affected.

What it is: CVE-2026-104859 is a high-severity command injection vulnerability in nrwl nx, published on 2 Oct 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-104859 in the wild and no public exploit code.

Affected packages and fixed versions:
- @nx/docker (npm): affected from 21.4.0; fixed in 22.7.8
- @nx/docker (npm): affected from 21.4.0; fixed in 22.7.8
- @nx/docker (npm): affected from 23.0.0; fixed in 23.1.1
- @nx/docker (npm): affected from 23.0.0; fixed in 23.1.1

Task:
1. 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.
2. 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.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-104859/ (Markdown: https://insights.sbomify.com/CVE-2026-104859/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-104859
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-104859
- OSV: https://osv.dev/vulnerability/CVE-2026-104859

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-104859/
Summaries are generated and may contain mistakes; the official description above is the record.
