GHSA-G2R8-WVMJ-JF5W

Vulnerability from github – Published: 2026-07-31 16:50 – Updated: 2026-07-31 16:50
VLAI
Summary
`nx graph` dev server permissive CORS policy
Details

Summary

The local HTTP server started by nx graph sent Access-Control-Allow-Origin: * on every response, letting any website a developer visited read the server's responses cross-origin — including the full project graph and the output of the /help endpoint, which runs a target's configured help command. The practical impact is typically cross-origin information disclosure, but can be arbitrary command injection in rare cases.

Severity

Exploitation requires the developer to be running nx graph and to visit an attacker page. Any execution beyond benign help commands also requires a malicious target to already be present in the workspace (see Details).

Affected & Patched Versions

Package: nx (npm).

  • Affected: >= 17.0.4, < 22.7.2 and >= 23.0.0-beta.0, < 23.0.0-beta.2
  • Patched: 22.7.2+ (backport) and 23.0.0 (first in 23.0.0-beta.2)

The wildcard CORS header was introduced in 17.0.4; the /help execution endpoint in 19.4.0. The 21.x line is not patched21.x users should upgrade to 22.7.2 or later.

Details

nx graph starts a local server (default http://127.0.0.1:4211). Before the fix, its request handler set a wildcard CORS header on every response:

res.setHeader('Access-Control-Allow-Origin', '*');

The /help endpoint runs a target's configured command:

const command = target.metadata?.help?.command;
return execSync(command, { cwd: target.options?.cwd ?? workspaceRoot }).toString();

A GET /help is a CORS "simple request", so a malicious page could fetch() it with no preflight, and the wildcard header let the page read the result. This exposes the project graph (project names, file paths, dependencies, build configuration) and the output of any configured help command.

The command is not attacker-controlled through the request — it comes from the workspace's project configuration, and first-party plugins (jest, vite, cypress) populate it with benign, read-only help commands. For /help to run anything malicious, a target carrying a malicious help.command must already exist in the project graph, which can only be introduced by installing a malicious package or by altering the workspace's own code/configuration — both of which already grant code execution independent of this flaw.

The fix (#35494) removes the header; the browser's same-origin policy then blocks cross-origin reads.

References

Credits

Thanks to Nozomu Sasaki (Paul) (@morimori-dev) for finding and responsibly reporting this issue.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "nx"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "17.0.4"
            },
            {
              "fixed": "22.7.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "nx"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "23.0.0-beta.0"
            },
            {
              "fixed": "23.0.0-beta.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-54753"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-749",
      "CWE-942"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-31T16:50:24Z",
    "nvd_published_at": "2026-06-26T19:16:43Z",
    "severity": "MODERATE"
  },
  "details": "## Summary\n\nThe local HTTP server started by `nx graph` sent `Access-Control-Allow-Origin: *` on every response, letting any website a developer visited read the server\u0027s responses cross-origin \u2014 including the full project graph and the output of the `/help` endpoint, which runs a target\u0027s configured help command. The practical impact is typically **cross-origin information disclosure**, but can be arbitrary command injection in rare cases.\n\n## Severity\n\n\nExploitation requires the developer to be running `nx graph` and to visit an attacker page. Any execution beyond benign help commands also requires a malicious target to already be present in the workspace (see Details).\n\n## Affected \u0026 Patched Versions\n\nPackage: `nx` (npm).\n\n- **Affected:** `\u003e= 17.0.4, \u003c 22.7.2` and `\u003e= 23.0.0-beta.0, \u003c 23.0.0-beta.2`\n- **Patched:** `22.7.2`+ (backport) and `23.0.0` (first in `23.0.0-beta.2`)\n\nThe wildcard CORS header was introduced in `17.0.4`; the `/help` execution endpoint in `19.4.0`. **The `21.x` line is not patched** \u2014 `21.x` users should upgrade to `22.7.2` or later.\n\n## Details\n\n`nx graph` starts a local server (default `http://127.0.0.1:4211`). Before the fix, its request handler set a wildcard CORS header on every response:\n\n```ts\nres.setHeader(\u0027Access-Control-Allow-Origin\u0027, \u0027*\u0027);\n```\n\nThe `/help` endpoint runs a target\u0027s configured command:\n\n```ts\nconst command = target.metadata?.help?.command;\nreturn execSync(command, { cwd: target.options?.cwd ?? workspaceRoot }).toString();\n```\n\nA `GET /help` is a CORS \"simple request\", so a malicious page could `fetch()` it with no preflight, and the wildcard header let the page read the result. This exposes the project graph (project names, file paths, dependencies, build configuration) and the output of any configured help command.\n\nThe command is not attacker-controlled through the request \u2014 it comes from the workspace\u0027s project configuration, and first-party plugins (jest, vite, cypress) populate it with benign, read-only help commands. For `/help` to run anything malicious, a target carrying a malicious `help.command` must already exist in the project graph, which can only be introduced by **installing a malicious package** or by **altering the workspace\u0027s own code/configuration** \u2014 both of which already grant code execution independent of this flaw.\n\nThe fix ([#35494](https://github.com/nrwl/nx/pull/35494)) removes the header; the browser\u0027s same-origin policy then blocks cross-origin reads.\n\n## References\n\n- Fix: [nrwl/nx#35494](https://github.com/nrwl/nx/pull/35494)\n- Introduced: [nrwl/nx#20744](https://github.com/nrwl/nx/pull/20744) (CORS), [nrwl/nx#26629](https://github.com/nrwl/nx/pull/26629) (`/help`)\n\n## Credits\n\nThanks to Nozomu Sasaki (Paul) ([@morimori-dev](https://github.com/morimori-dev)) for finding and responsibly reporting this issue.",
  "id": "GHSA-g2r8-wvmj-jf5w",
  "modified": "2026-07-31T16:50:24Z",
  "published": "2026-07-31T16:50:24Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/nrwl/nx/security/advisories/GHSA-g2r8-wvmj-jf5w"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-54753"
    },
    {
      "type": "WEB",
      "url": "https://github.com/nrwl/nx/pull/35494"
    },
    {
      "type": "WEB",
      "url": "https://github.com/nrwl/nx/commit/7620c1ffe598086ce5e66457c7e6e38799bb499d"
    },
    {
      "type": "WEB",
      "url": "https://github.com/nrwl/nx/commit/e59122c5569cf201561b9995ce4e34a304f4fb03"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/nrwl/nx"
    },
    {
      "type": "WEB",
      "url": "https://github.com/nrwl/nx/releases/tag/22.7.2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "`nx graph` dev server permissive CORS policy"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…