Skip to main content
← All vulnerabilities
CVE-2026-119282EUVD-2026-113391GHSA-QM8W-VX34-5J9J

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.

Published
Last modified
published
Not listed in CISA KEV
Specific setups only
Fix
Fixed in 22.7.9, 23.1.2
None on Exploit-DB, Metasploit or GitHub

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.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original 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.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • 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/mavennpm

    From 22.0.2 · fixed in 22.7.9

  • @nx/mavennpm

    From 23.0.0 · fixed in 23.1.2

  • @nx/gradlenpm

    From 21.0.0 · fixed in 22.7.9

  • @nx/gradlenpm

    From 23.0.0 · fixed in 23.1.2

References 7

GitHub · nrwl/nx

FAQ

Questions about CVE-2026-119282

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: github.com

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: github.com

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: github.com

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: cve.now feed data