CVE-2026-119282

Nx: OS command injection via nx.json plugin options in @nx/maven and @nx/gradle

Published Oct 29, 2026 CVSS 4.0 · 7.3 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

Nx, a monorepo solution for TypeScript, allows developers to run a project graph analyzer that expands plugin options from nx.json into shell command arguments. The @nx/maven targetNamePrefix and arbitrary @nx/gradle option names or values are interpreted as shell syntax when a graph is constructed. An attacker who can inject malicious content into nx.json can therefore cause the Maven or Gradle target to execute arbitrary OS commands with the privileges of the user running the Nx command. This flaw aligns with CWE‑78 (OS Command Injection) and CWE‑88 (Exploitable Filter), providing a direct route to execute attacker‑chosen commands on the host system.

Affected Systems

Affected plugins are @nx/maven and @nx/gradle. For @nx/maven, vulnerabilities exist in versions 22.0.2 through 22.7.9 and in 23.1.2. For @nx/gradle, the affected range is 21.0.0 through 22.7.9 and in 23.1.2. The monorepo manager package nrwl:nx must also be updated to matching releases because the plugin fix relies on code changes in that package.

Risk and Exploitability

The CVSS score of 7.3 indicates a high impact if exploited. The EPSS score is not available, so the current exploitation likelihood cannot be quantified. The vulnerability is not included in the CISA KEV catalog. Exploitation requires an attacker to inject malicious nx.json into a repository or pull request and trigger an NX graph construction, typically during CI or local development. The attack vector is confined to environments where a user runs the NX command; remote network exploitation is not required.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the nx package to version 22.7.9 or later (23.1.2) and ensure that the @nx/maven and @nx/gradle plugins are updated to corresponding releases that include the patch.
  • Modify or remove any nx.json plugin options that contain user‑supplied values, ensuring that only static, validated options are used in project graph analysis.
  • If an upgrade cannot be performed immediately, restrict execution of Nx commands to trusted repositories or CI environments that run with the least necessary privileges to mitigate the risk of accidental injection.

Generated by OpenCVE AI on October 29, 2026 at 22:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-qm8w-vx34-5j9j @nx/maven and @nx/gradle have OS command injection via nx.json plugin options
History
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

threat_severity

Important

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Nrwl
Nrwl gradle
Nrwl maven
Nrwl nx
Vendors & Products Nrwl
Nrwl gradle
Nrwl maven
Nrwl nx
Type Values Removed Values Added
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.
Title Nx: OS command injection via nx.json plugin options in @nx/maven and @nx/gradle
Weaknesses CWE-78
CWE-88
References
Metrics cvssV4_0

{'score': 7.3, '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'}

Weaknesses
  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

  • CWE-88

    Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 3, 2026, 4:50 PM
Reserved
Oct 29, 2026, 6:50 PM
Status
Awaiting Analysis
Published
Oct 29, 2026, 10:17 PM
Modified
Nov 3, 2026, 5:18 PM
Severity
Important
Public date
Oct 29, 2026, 9:07 PM