---
title: "GHSA-qm8w-vx34-5j9j: @nx/maven and @nx/gradle have OS command injection via nx.json plugin options"
description: "High severity. @nx/maven and @nx/gradle have OS command injection via nx.json plugin options. Affects @nx/gradle, @nx/maven; fixed in 23.1.2."
url: https://inlinr.com/advisories/GHSA-qm8w-vx34-5j9j
lang: en
---

[Packages](https://inlinr.com/packages)

High Vulnerability GHSA-qm8w-vx34-5j9j CVE-2026-119282 Published 30 Oct 2026

# @nx/maven and @nx/gradle have OS command injection via nx.json plugin options

Your version of @nx/gradle 

Affected releases · [@nx/gradle](https://inlinr.com/packages/@nx/gradle)

- 23.x 23.0.0 – 23.1.1 Fixed in 23.1.2
- 22.x 22.0.0 – 22.7.8 Fixed in 22.7.9
- 21.x 21.0.0 – 21.6.11 No fix on this line yet

On 23.x, the newest line:

```
npm install @nx/gradle@23.1.2
```

Every release on a timeline

24.x 

1. Not affected

24.0.0 – 24.0.6  
7 releases, latest

23.x 

1. Affected

23.0.0 – 23.1.1  
5 releases
2. Fixed

23.1.2 – 23.3.3  
8 releases

22.x 

1. Affected

22.0.0 – 22.7.8  
47 releases
2. Fixed

22.7.9 – 22.7.12  
4 releases

21.x 

1. Affected

21.0.0 – 21.6.11  
43 releases

241 stable releases of @nx/gradle, oldest to newest, one row per major.

Your version of @nx/maven 

Affected releases · [@nx/maven](https://inlinr.com/packages/@nx/maven)

- 23.x 23.0.0 – 23.1.1 Fixed in 23.1.2
- 22.x 22.0.2 – 22.7.8 Fixed in 22.7.9

On 23.x, the newest line:

```
npm install @nx/maven@23.1.2
```

Every release on a timeline

24.x 

1. Not affected

24.0.0 – 24.0.6  
7 releases, latest

23.x 

1. Affected

23.0.0 – 23.1.1  
5 releases
2. Fixed

23.1.2 – 23.3.2  
7 releases

22.x 

1. Not affected

22.0.0 – 22.0.1  
2 releases
2. Affected

22.0.2 – 22.7.8  
45 releases
3. Fixed

22.7.9 – 22.7.12  
4 releases

71 stable releases of @nx/maven, oldest to newest, one row per major.

## What happens

Summary

[@nx/maven](https://inlinr.com/packages/@nx/maven) and [@nx/gradle](https://inlinr.com/packages/@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](https://inlinr.com/packages/@nx/maven)   | \>= 22.0.2, < 22.7.9; \>= 23.0.0, < 23.1.2 | 22.7.9, 23.1.2 |
| [@nx/gradle](https://inlinr.com/packages/@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](https://inlinr.com/packages/@nx/maven) nor [@nx/gradle](https://inlinr.com/packages/@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](https://inlinr.com/packages/@nx/maven) and/or [@nx/gradle](https://inlinr.com/packages/@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

## How it is exploited

Exploitable with local access, with no account and a user to do something.

- **Confidentiality**: high
- **Integrity**: high
- **Availability**: high

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

## References

- [Reference](https://github.com/nrwl/nx/security/advisories/GHSA-qm8w-vx34-5j9j "https://github.com/nrwl/nx/security/advisories/GHSA-qm8w-vx34-5j9j")  
github.com/nrwl/nx/security/advisories/GHSA-qm8…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-119282 "https://nvd.nist.gov/vuln/detail/CVE-2026-119282")  
nvd.nist.gov/vuln/detail/CVE-2026-119282
- [Pull request](https://github.com/nrwl/nx/pull/36626 "https://github.com/nrwl/nx/pull/36626")  
#36626
- [Fix commit](https://github.com/nrwl/nx/commit/02c5d59e8dbbbe30963c0181c6a22cd8c1190a25 "https://github.com/nrwl/nx/commit/02c5d59e8dbbbe30963c0181c6a22cd8c1190a25")  
02c5d59
- [Fix commit](https://github.com/nrwl/nx/commit/60196b7cfcffcada35b6b90e53bf1a78d049b548 "https://github.com/nrwl/nx/commit/60196b7cfcffcada35b6b90e53bf1a78d049b548")  
60196b7
- [Fix commit](https://github.com/nrwl/nx/commit/c227f4780b054c512965c73aa480a48f9f781409 "https://github.com/nrwl/nx/commit/c227f4780b054c512965c73aa480a48f9f781409")  
c227f47
- [Package](https://github.com/nrwl/nx "https://github.com/nrwl/nx")  
github.com/nrwl/nx
- [Reference](https://github.com/nrwl/nx/releases/tag/22.7.9 "https://github.com/nrwl/nx/releases/tag/22.7.9")  
github.com/nrwl/nx/releases/tag/22.7.9
- [Reference](https://github.com/nrwl/nx/releases/tag/23.1.2 "https://github.com/nrwl/nx/releases/tag/23.1.2")  
github.com/nrwl/nx/releases/tag/23.1.2

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
