Summary
@nx/maven and @nx/gradle have OS command injection via nx.json plugin options
@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.
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
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.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.
Frequently Asked Questions
- What is CVE-2026-119282? CVE-2026-119282 is a high-severity OS command injection vulnerability in @nx/maven (npm), affecting versions >= 22.0.2, < 22.7.9. It is fixed in 22.7.9, 23.1.2. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
- Which packages are affected by CVE-2026-119282?
@nx/maven(npm) (versions >= 22.0.2, < 22.7.9)@nx/gradle(npm) (versions >= 21.0.0, < 22.7.9)
- Is there a fix for CVE-2026-119282? Yes. CVE-2026-119282 is fixed in 22.7.9, 23.1.2. Upgrade to this version or later.
- Is CVE-2026-119282 exploitable, and should I be worried? Whether CVE-2026-119282 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-119282 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-119282?
- Upgrade
@nx/mavento 22.7.9 or later - Upgrade
@nx/mavento 23.1.2 or later - Upgrade
@nx/gradleto 22.7.9 or later - Upgrade
@nx/gradleto 23.1.2 or later
- Upgrade