Nx Maven and Gradle plugins: OS command injection (CVE-2026-119282)
The @nx/maven and @nx/gradle plugins contain an OS command injection vulnerability where unsafely interpolated nx.json configuration options lead to arbitrary command execution during project-graph analysis.
CVE search metadata
CVE search record: CVE-2026-119282. KEV: no. Product: @nx/maven (>= 22.0.2, < 22.7.9; >= 23.0.0, < 23.1.2), @nx/gradle (>= 21.0.0, < 22.7.9; >= 23.0.0, < 23.1.2). Brief: Nx Maven and Gradle plugins: OS command injection (CVE-2026-119282). Brief link: https://feed.craftedsignal.io/briefs/2026-10-nx-maven-gradle-rce/
Triage facts
Revision 1- Applicability
- @nx/maven (>= 22.0.2, < 22.7.9; >= 23.0.0, < 23.1.2), @nx/gradle (>= 21.0.0, < 22.7.9; >= 23.0.0, < 23.1.2)
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 2 public sources
- Freshness
- Revision 1Oct 30, 15:10 UTC
- Vulnerabilities
- 1 CVE
- Source quality
- A1Roughly even chance
The Nx plugins @nx/maven and @nx/gradle are susceptible to OS command injection due to insecure interpolation of plugin options from nx.json into shell commands. This vulnerability is triggered whenever an nx command initiates project-graph analysis in a workspace containing a maliciously crafted nx.json.
For @nx/maven, the injectable option is targetNamePrefix. For @nx/gradle, the vulnerability is more extensive, as arbitrary plugin option names and values are interpolated into command-line arguments. This flaw poses a risk to CI environments and local developers working within untrusted repositories. There is no evidence of active exploitation in the wild.
Impact
Successful exploitation allows arbitrary command execution under the privileges of the user running the nx command. This represents a significant risk in automated CI pipelines that process pull requests or external repositories, as an attacker with write access to the nx.json file can execute code without requiring access to build files themselves.
Recommendation
- Upgrade
@nx/mavenand@nx/gradleto version 22.7.9 (for the 22.x line) or 23.1.2 (for the 23.x line) or later. - Upgrading the plugin alone is insufficient; users must ensure the core
nxpackage is also upgraded to a compatible version as the fix depends on updated core code. - Use
nx migrate 23.1.2to update the project dependencies. - Until updates are applied, restrict the execution of
nxcommands to repositories from trusted sources only.
Immediate actions
Upgrade affected Nx workspaces to @nx/maven or @nx/gradle versions 22.7.9 or 23.1.2
Threat Hunt
Identify CI/CD pipelines or local developer environments executing nx commands on external or untrusted repositories.
Data: CI/CD execution logs, Repository manifest analysis
Mitigations
Enforce strict trust policies for code execution in CI/CD, specifically avoiding automatic execution of 'nx' commands on unverified pull requests.
CVE-2026-119282