{"id":"CVE-2026-54753","aliases":["CVE-2026-54753","GHSA-g2r8-wvmj-jf5w"],"related":[],"kind":"vulnerability","state":"published","title":"Nx: `nx graph` dev server permissive CORS policy","summary":"Nx is a monorepo solution for TypeScript and polyglot codebases. From 17.0.4 until 22.7.2 and 23.0.0-beta.2, 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. This vulnerability is fixed in 22.7.2 and 23.0.0-beta.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Nx is a monorepo solution for TypeScript and polyglot codebases. From 17.0.4 until 22.7.2 and 23.0.0-beta.2, 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. This vulnerability is fixed in 22.7.2 and 23.0.0-beta.2.","source":"cvelist"},{"lang":"en","text":"## 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'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.\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 & Patched Versions\n\nPackage: `nx` (npm).\n\n- **Affected:** `>= 17.0.4, < 22.7.2` and `>= 23.0.0-beta.0, < 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** — `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('Access-Control-Allow-Origin', '*');\n```\n\nThe `/help` endpoint runs a target's 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 — 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.\n\nThe fix ([#35494](https://github.com/nrwl/nx/pull/35494)) removes the header; the browser's 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Nx es una solución de monorepo para bases de código TypeScript y políglotas. Desde 17.0.4 hasta 22.7.2 y 23.0.0-beta.2, el servidor HTTP local iniciado por nx graph envió Access-Control-Allow-Origin: * en cada respuesta, permitiendo que cualquier sitio web que un desarrollador visitara leyera las respuestas del servidor de origen cruzado - incluyendo el grafo completo del proyecto y la salida del endpoint /help, que ejecuta el comando de ayuda configurado de un objetivo. El impacto práctico es típicamente revelación de información de origen cruzado, pero puede ser inyección de comandos arbitraria en casos raros. Esta vulnerabilidad está corregida en 22.7.2 y 23.0.0-beta.2.","source":"nvd"}],"published":"2026-06-26T18:13:34.371Z","modified":"2026-10-25T17:10:00.197Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-749","CWE-942"],"affected":[{"ranges":[{"version":">= 17.0.4, < 22.7.2","status":"affected"},{"version":">= 23.0.0-beta.0, < 23.0.0-beta.2","status":"affected"}],"vendor":"nrwl","product":"nx","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"17.0.4","status":"affected","fixed":"22.7.2"}],"ecosystem":"npm","package":"nx","purl":"pkg:npm/nx","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"23.0.0-beta.0","status":"affected","fixed":"23.0.0-beta.2"}],"ecosystem":"npm","package":"nx","purl":"pkg:npm/nx","source":"ghsa"}],"references":[{"url":"https://github.com/nrwl/nx/security/advisories/GHSA-g2r8-wvmj-jf5w","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/nrwl/nx/pull/35494","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54753","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nrwl/nx/commit/7620c1ffe598086ce5e66457c7e6e38799bb499d","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nrwl/nx/commit/e59122c5569cf201561b9995ce4e34a304f4fb03","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nrwl/nx","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nrwl/nx/releases/tag/22.7.2","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-26T19:09:19.972Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-54753","url":"https://www.cve.org/CVERecord?id=CVE-2026-54753","licence":"CVE Terms of Use","modified":"2026-06-26T19:09:33.257Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g2r8-wvmj-jf5w","url":"https://github.com/advisories/GHSA-g2r8-wvmj-jf5w","licence":"CC-BY-4.0","modified":"2026-07-31T17:00:20.626Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-54753","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54753","licence":"Public domain","modified":"2026-10-25T17:10:00.197Z"}],"updatedAt":"2026-11-25T22:59:26.514Z","epss":{"score":0.00974,"percentile":0.63065,"date":"2026-12-01T12:00:22.000Z"}}