CVE-2026-104859: Nx: OS command injection in the @nx/docker release pipeline
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
@nx/dockerto a version that resolves this vulnerability.Fixed in 22.7.8 - Upgrade
Upgrade
@nx/dockerto a version that resolves this vulnerability.Fixed in 23.1.1
Event History
Frequently Asked Questions
Which environments are most exposed to exploitation?
CI/CD release jobs that run nx release version or nx release publish and use @nx/docker are exposed when an attacker can introduce or alter Nx configuration, such as through a pull request or repository configuration change. Successful exploitation runs commands with the release job's privileges and may expose registry credentials or cloud tokens.
Does using dry-run publishing prevent command execution?
No. Dry-run publishing does not prevent the vulnerable pre-check command from executing.
Which configuration values must be treated as untrusted?
The release.docker.repositoryName and registryUrl values are interpolated into shell command strings passed to /bin/sh -c. Shell syntax in either value can execute commands during the affected release operations.
Which versions contain the fix?
The issue is fixed in @nx/docker versions 22.7.8 and 23.1.1. Affected version ranges are 21.4.0 through before 22.7.8, and 23.0.0 through before 23.1.1.