CVE-2026-104859: @nx/docker OS Command Injection Vulnerability

HIGH
Advisory Identifier: GHSA-6vc5-vf29-ffr2
CWE-78
Published
Advisory Summary

CVE-2026-104859 is a HIGH os command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting @nx/docker libraries in the npm ecosystem. The issue involves os command injection in the @nx/docker release pipeline. Remediation is available by upgrading affected packages to version 22.7.8, 23.1.1.

CVE-2026-104859 at a Glance

CVE Identifier CVE-2026-104859
GHSA Identifier GHSA-6vc5-vf29-ffr2
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product @nx/docker
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-104859

To remediate this vulnerability, upgrade all affected @nx/docker dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@nx/docker fixed: 22.7.8
npm install @nx/docker@22.7.8
@nx/docker fixed: 23.1.1
npm install @nx/docker@23.1.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @nx/docker

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-104859, inspect your project dependencies using npm:

npm ls @nx/docker

Analyze the terminal output to locate any version of @nx/docker in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 22.7.8), your application is affected.

Note: The npm ls @nx/docker command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In @nx/docker, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary 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. ## Remediation 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. ## 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

CVE-2026-104859 Affected @nx/docker Versions

2 component(s)
Fixed Versions:
22.7.823.1.1
Product / Package Ecosystem Affected Versions Fixed Version
@nx/docker
npm
≥ 21.4.0
< 22.7.8
22.7.8
@nx/docker
npm
≥ 23.0.0
< 23.1.1
23.1.1

References

Frequently Asked Questions

What is CVE-2026-104859?
CVE-2026-104859 is a security vulnerability in @nx/docker involving OS command injection in the @nx/docker release pipeline under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which @nx/docker versions are affected?
Affected versions include releases prior to 22.7.8, 23.1.1 across affected packages: @nx/docker.
What version fixes CVE-2026-104859?
Upgrading to 22.7.8, 23.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @nx/docker affected?
Yes, @nx/docker is affected in releases prior to 22.7.8, 23.1.1. Upgrade your dependency to 22.7.8, 23.1.1 or later.
What CWE is associated with CVE-2026-104859?
CVE-2026-104859 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2026-104859?
Run the dependency tree command: 'npm ls @nx/docker'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6vc5-vf29-ffr2",
  "modified" : "2026-10-05T23:29:13Z",
  "published" : "2026-10-05T23:29:13Z",
  "aliases" : [ "CVE-2026-104859" ],
  "summary" : "@nx/docker: OS command injection in the @nx/docker release pipeline",
  "details" : "## 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",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nx/docker"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "21.4.0"
      }, {
        "fixed" : "22.7.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nx/docker"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "23.0.0"
      }, {
        "fixed" : "23.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nrwl/nx/security/advisories/GHSA-6vc5-vf29-ffr2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-104859"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nrwl/nx/pull/36505"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nrwl/nx/commit/6d60eed061f050e0d5af509a1f5a07c707f09865"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nrwl/nx/commit/b587441fd8da28c5db37edb0826554e0060dc81b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nrwl/nx"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-05T23:29:13Z",
    "nvd_published_at" : "2026-10-02T18:17:02Z"
  }
}