Investigate in your agent.

Turn this advisory into a focused investigation. Ask your agent to check your project’s versions, explain the evidence, and suggest a compatible fix.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

Skip to content
Check your stack
CVE-2026-119282high7.3

Nx: OS command injection via nx.json plugin options in @nx/maven and @nx/gradle

Impact

@nx/maven and @nx/gradle spawn their project-graph analyzers through a shell and interpolate plugin options read from nx.json straight into the command line. Because a shell parses the whole line, an option value containing shell syntax is executed as a command by any nx command that constructs the project graph. Anyone who clones a hostile repository, or who checks out a pull request that edits nx.json, runs the injected command with their own privileges.

Source excerpt · OSV

Affected packages

Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.

Affected range Recorded fix
From 22.0.2 before 22.7.9Semantic versions22.7.9
From 23.0.0 before 23.1.2Semantic versions23.1.2

Version evidence: OSV · GHSA-qm8w-vx34-5j9j

View original version evidence (0 explicit versions)
Affected range Recorded fix
From 21.0.0 before 22.7.9Semantic versions22.7.9
From 23.0.0 before 23.1.2Semantic versions23.1.2

Version evidence: OSV · GHSA-qm8w-vx34-5j9j

View original version evidence (0 explicit versions)

Affected products

Vendor version evidence. Product records are separate from automatic dependency matching.

nrwl · GitHub_M

nx

2 ranges

Compare with this publisher’s ranges. This does not inspect your installation.

affected

>= 21.0.0, < 22.7.9

>= 23.0.0, < 23.1.2

unaffected

unknown

Other versions: unknown

@nx · GitHub_M

maven

2 ranges

Compare with this publisher’s ranges. This does not inspect your installation.

affected

>= 21.0.0, < 22.7.9

>= 23.0.0, < 23.1.2

unaffected

unknown

Other versions: unknown

@nx · GitHub_M

gradle

2 ranges

Compare with this publisher’s ranges. This does not inspect your installation.

affected

>= 21.0.0, < 22.7.9

>= 23.0.0, < 23.1.2

unaffected

unknown

Other versions: unknown

Original source description

Summary

@nx/maven and @nx/gradle spawn their project-graph analyzers through a shell and interpolate plugin options read from nx.json straight into the command line. Because a shell parses the whole line, an option value containing shell syntax is executed as a command by any nx command that constructs the project graph. Anyone who clones a hostile repository, or who checks out a pull request that edits nx.json, runs the injected command with their own privileges.

Severity

A victim who runs an ordinary nx command in an attacker-supplied Maven or Gradle workspace gets code execution as themselves. In most such workspaces an attacker who can write nx.json can already run code through the repository's build files (./mvnw, pom.xml, and the Gradle equivalents), so the genuinely new exposure is narrow — for example CI building a fork's pull request where nx.json is writable but the build files are not. We have no evidence of exploitation in the wild.

Affected & Patched Versions

Package Vulnerable Patched
@nx/maven >= 22.0.2, < 22.7.9; >= 23.0.0, < 23.1.2 22.7.9, 23.1.2
@nx/gradle >= 21.0.0, < 22.7.9; >= 23.0.0, < 23.1.2 22.7.9, 23.1.2

[!IMPORTANT] Workspaces that register neither @nx/maven nor @nx/gradle in nx.json are unaffected — the vulnerable code only runs from those plugins' graph-construction paths, and no other Nx plugin shares this pattern.

Remediation

Upgrade to 22.7.9 (22.x line) or 23.1.2 (23.x line) or later:

nx migrate 23.1.2

Upgrade both nx and the affected plugin (@nx/maven and/or @nx/gradle). The plugin's fix depends on code that ships in the nx package, so bumping the plugin without a matching nx upgrade will not resolve it.

There is no configuration to change — upgrading is the whole fix. If you cannot upgrade yet, only run nx commands in repositories you trust, since a malicious nx.json can execute code on a vulnerable version.

Details

Both plugins spawn their analyzer through a shell and interpolate nx.json plugin options into the command, so those option values are shell source. For Maven the injectable value is the targetNamePrefix option; for Gradle it is broader, since every plugin option is mapped into a -P argument and arbitrary option names are accepted, making both the name and value of any option injectable.

Credits

  • Arkadiusz Marta (RE:SOURCE) — Reporter

Inside the record

Evidence available

Package identity
Version evidence
Remediation guidance · not supplied
Weakness classification
Additional publishers · not supplied

Describes the evidence in this view, not whether the product is safe.

Original records

CVE-2026-119282

View the latest unmodified CVE JSON from the official source. It may be newer than this imported page.

cve.new JSON →

Underlying weaknesses

The source’s classification of what caused the vulnerability.

CWE-78 ↗

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

GitHub_M

Related →
CWE-88 ↗

CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

GitHub_M

Related →
Contributing organizations · 1
GitHub_M

Assigning organization

2026-10-29

What changed

Follow changes
No substantive changes have been recorded here yet. History starts when cve.new observes a change after tracking is enabled; earlier edits are not reconstructed.

Large field values are marked as truncated previews. Original source snapshots remain retained.

References

9 sources