Skip to content

Commit bb3024a

Browse files
1 parent 1bf0f68 commit bb3024a

4 files changed

Lines changed: 371 additions & 7 deletions

File tree

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-4w7w-66w2-5vf9",
4+
"modified": "2026-04-06T18:03:46Z",
5+
"published": "2026-04-06T18:03:46Z",
6+
"aliases": [],
7+
"summary": "Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling",
8+
"details": "### Summary\n\nAny files ending with `.map` even out side the project can be returned to the browser.\n\n### Impact\n\nOnly apps that match the following conditions are affected:\n\n- explicitly exposes the Vite dev server to the network (using `--host` or [`server.host` config option](https://vitejs.dev/config/server-options.html#server-host))\n- have a sensitive content in files ending with `.map` and the path is predictable\n\n### Details\n\nIn Vite v7.3.1, the dev server’s handling of `.map` requests for optimized dependencies resolves file paths and calls `readFile` without restricting `../` segments in the URL. As a result, it is possible to bypass the [`server.fs.strict`](https://vite.dev/config/server-options#server-fs-strict) allow list and retrieve `.map` files located outside the project root, provided they can be parsed as valid source map JSON.\n\n### PoC\n1. Create a minimal PoC sourcemap outside the project root\n ```bash\n cat > /tmp/poc.map <<'EOF'\n {\"version\":3,\"file\":\"x.js\",\"sources\":[],\"names\":[],\"mappings\":\"\"}\n EOF\n ```\n2. Start the Vite dev server (example)\n ```bash\n pnpm -C playground/fs-serve dev --host 127.0.0.1 --port 18080\n ```\n3. Confirm that direct `/@fs` access is blocked by `strict` (returns 403)\n <img width=\"4004\" height=\"1038\" alt=\"image\" src=\"https://github.com/user-attachments/assets/15a859a8-1dc6-4105-8d58-80527c0dd9ab\" />\n4. Inject `../` segments under the optimized deps `.map` URL prefix to reach `/tmp/poc.map`\n <img width=\"2790\" height=\"846\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5d02957d-2e6a-4c45-9819-3f024e0e81f2\" />",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "npm",
19+
"name": "vite"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "8.0.0"
27+
},
28+
{
29+
"fixed": "8.0.5"
30+
}
31+
]
32+
}
33+
],
34+
"database_specific": {
35+
"last_known_affected_version_range": "<= 8.0.4"
36+
}
37+
},
38+
{
39+
"package": {
40+
"ecosystem": "npm",
41+
"name": "vite"
42+
},
43+
"ranges": [
44+
{
45+
"type": "ECOSYSTEM",
46+
"events": [
47+
{
48+
"introduced": "7.0.0"
49+
},
50+
{
51+
"fixed": "7.3.2"
52+
}
53+
]
54+
}
55+
],
56+
"database_specific": {
57+
"last_known_affected_version_range": "<= 7.3.1"
58+
}
59+
},
60+
{
61+
"package": {
62+
"ecosystem": "npm",
63+
"name": "vite"
64+
},
65+
"ranges": [
66+
{
67+
"type": "ECOSYSTEM",
68+
"events": [
69+
{
70+
"introduced": "0"
71+
},
72+
{
73+
"fixed": "6.4.2"
74+
}
75+
]
76+
}
77+
],
78+
"database_specific": {
79+
"last_known_affected_version_range": "<= 6.4.1"
80+
}
81+
}
82+
],
83+
"references": [
84+
{
85+
"type": "WEB",
86+
"url": "https://github.com/vitejs/vite/security/advisories/GHSA-4w7w-66w2-5vf9"
87+
},
88+
{
89+
"type": "WEB",
90+
"url": "https://github.com/vitejs/vite/pull/22161"
91+
},
92+
{
93+
"type": "WEB",
94+
"url": "https://github.com/vitejs/vite/commit/79f002f2286c03c88c7b74c511c7f9fc6dc46694"
95+
},
96+
{
97+
"type": "PACKAGE",
98+
"url": "https://github.com/vitejs/vite"
99+
},
100+
{
101+
"type": "WEB",
102+
"url": "https://github.com/vitejs/vite/releases/tag/v6.4.2"
103+
},
104+
{
105+
"type": "WEB",
106+
"url": "https://github.com/vitejs/vite/releases/tag/v7.3.2"
107+
},
108+
{
109+
"type": "WEB",
110+
"url": "https://github.com/vitejs/vite/releases/tag/v8.0.5"
111+
}
112+
],
113+
"database_specific": {
114+
"cwe_ids": [
115+
"CWE-200",
116+
"CWE-22"
117+
],
118+
"severity": "MODERATE",
119+
"github_reviewed": true,
120+
"github_reviewed_at": "2026-04-06T18:03:46Z",
121+
"nvd_published_at": null
122+
}
123+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-p9ff-h696-f583",
4+
"modified": "2026-04-06T18:03:24Z",
5+
"published": "2026-04-06T18:03:24Z",
6+
"aliases": [],
7+
"summary": "Vite Vulnerable to Arbitrary File Read via Vite Dev Server WebSocket",
8+
"details": "### Summary\n\n[`server.fs`](https://vite.dev/config/server-options#server-fs-strict) check was not enforced to the `fetchModule` method that is exposed in Vite dev server's WebSocket. \n\n### Impact\n\nOnly apps that match the following conditions are affected:\n\n- explicitly exposes the Vite dev server to the network (using `--host` or [`server.host` config option](https://vitejs.dev/config/server-options.html#server-host))\n- WebSocket is not disabled by `server.ws: false`\n\nArbitrary files on the server (development machine, CI environment, container, etc.) can be exposed.\n\n### Details\n\nIf 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 \"...\"`).\n\nThe access control enforced in the HTTP request path (such as `server.fs.allow`) is not applied to this WebSocket-based execution path.\n\n### PoC\n\n1. Start the dev server on the target \n Example (used during validation with this repository):\n ```bash\n pnpm -C playground/alias exec vite --host 0.0.0.0 --port 5173\n ```\n\n2. Confirm that access is blocked via the HTTP path (example: arbitrary file)\n ```bash\n curl -i 'http://localhost:5173/@fs/etc/passwd?raw'\n ```\n Result: `403 Restricted` (outside the allow list)\n <img width=\"3898\" height=\"1014\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f6593377-549c-45d7-b562-5c19833438af\" />\n\n3. Confirm that the same file can be retrieved via the WebSocket path\n By connecting to the HMR WebSocket without an `Origin` header and sending a `vite:invoke` request that calls `fetchModule` with a `file://...` URL and `?raw`, the file contents are returned as a JavaScript module.\n <img width=\"1049\" height=\"296\" alt=\"image\" src=\"https://github.com/user-attachments/assets/af969f7b-d34e-4af4-8adb-5e2b83b31972\" />\n <img width=\"1382\" height=\"955\" alt=\"image\" src=\"https://github.com/user-attachments/assets/6a230d2e-197a-4c9c-b373-d0129756d5d7\" />",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "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"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "npm",
19+
"name": "vite"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "8.0.0"
27+
},
28+
{
29+
"fixed": "8.0.5"
30+
}
31+
]
32+
}
33+
],
34+
"database_specific": {
35+
"last_known_affected_version_range": "<= 8.0.4"
36+
}
37+
},
38+
{
39+
"package": {
40+
"ecosystem": "npm",
41+
"name": "vite"
42+
},
43+
"ranges": [
44+
{
45+
"type": "ECOSYSTEM",
46+
"events": [
47+
{
48+
"introduced": "7.0.0"
49+
},
50+
{
51+
"fixed": "7.3.2"
52+
}
53+
]
54+
}
55+
],
56+
"database_specific": {
57+
"last_known_affected_version_range": "<= 7.3.1"
58+
}
59+
},
60+
{
61+
"package": {
62+
"ecosystem": "npm",
63+
"name": "vite"
64+
},
65+
"ranges": [
66+
{
67+
"type": "ECOSYSTEM",
68+
"events": [
69+
{
70+
"introduced": "6.0.0"
71+
},
72+
{
73+
"fixed": "6.4.2"
74+
}
75+
]
76+
}
77+
],
78+
"database_specific": {
79+
"last_known_affected_version_range": "<= 6.4.1"
80+
}
81+
}
82+
],
83+
"references": [
84+
{
85+
"type": "WEB",
86+
"url": "https://github.com/vitejs/vite/security/advisories/GHSA-p9ff-h696-f583"
87+
},
88+
{
89+
"type": "WEB",
90+
"url": "https://github.com/vitejs/vite/pull/22159"
91+
},
92+
{
93+
"type": "WEB",
94+
"url": "https://github.com/vitejs/vite/commit/f02d9fde0b195afe3ea2944414186962fbbe41e0"
95+
},
96+
{
97+
"type": "PACKAGE",
98+
"url": "https://github.com/vitejs/vite"
99+
},
100+
{
101+
"type": "WEB",
102+
"url": "https://github.com/vitejs/vite/releases/tag/v6.4.2"
103+
},
104+
{
105+
"type": "WEB",
106+
"url": "https://github.com/vitejs/vite/releases/tag/v7.3.2"
107+
},
108+
{
109+
"type": "WEB",
110+
"url": "https://github.com/vitejs/vite/releases/tag/v8.0.5"
111+
}
112+
],
113+
"database_specific": {
114+
"cwe_ids": [
115+
"CWE-200",
116+
"CWE-306"
117+
],
118+
"severity": "HIGH",
119+
"github_reviewed": true,
120+
"github_reviewed_at": "2026-04-06T18:03:24Z",
121+
"nvd_published_at": null
122+
}
123+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-v2wj-q39q-566r",
4+
"modified": "2026-04-06T18:03:32Z",
5+
"published": "2026-04-06T18:03:32Z",
6+
"aliases": [],
7+
"summary": "Vite: `server.fs.deny` bypassed with queries",
8+
"details": "### Summary\n\nThe contents of files that are specified by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny) can be returned to the browser.\n\n### Impact\n\nOnly apps that match the following conditions are affected:\n\n- explicitly exposes the Vite dev server to the network (using `--host` or [`server.host` config option](https://vitejs.dev/config/server-options.html#server-host))\n- the sensitive file exists in the allowed directories specified by [`server.fs.allow`](https://vite.dev/config/server-options#server-fs-allow)\n- the sensitive file is denied with a pattern that matches a file by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny)\n\n### Details\n\nOn the Vite dev server, files that should be blocked by `server.fs.deny` (e.g., `.env`, `*.crt`) can be retrieved with HTTP 200 responses when query parameters such as `?raw`, `?import&raw`, or `?import&url&inline` are appended.\n\n### PoC\n\n1. Start the dev server: `pnpm exec vite root --host 127.0.0.1 --port 5175 --strictPort`\n2. Confirm that `server.fs.deny` is enforced (expect 403): `curl -i http://127.0.0.1:5175/src/.env | head -n 20`\n <img width=\"3944\" height=\"1092\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ecb9f2e0-e08f-4ac7-b194-e0f988c4cd4f\" />\n3. Confirm that the same files can be retrieved with query parameters (expect 200):\n <img width=\"2014\" height=\"373\" alt=\"image\" src=\"https://github.com/user-attachments/assets/76bc2a6a-44f4-4161-ae47-eab5ae0c04a8\" />",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "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"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "npm",
19+
"name": "vite"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "8.0.0"
27+
},
28+
{
29+
"fixed": "8.0.5"
30+
}
31+
]
32+
}
33+
],
34+
"database_specific": {
35+
"last_known_affected_version_range": "<= 8.0.4"
36+
}
37+
},
38+
{
39+
"package": {
40+
"ecosystem": "npm",
41+
"name": "vite"
42+
},
43+
"ranges": [
44+
{
45+
"type": "ECOSYSTEM",
46+
"events": [
47+
{
48+
"introduced": "7.1.0"
49+
},
50+
{
51+
"fixed": "7.3.2"
52+
}
53+
]
54+
}
55+
],
56+
"database_specific": {
57+
"last_known_affected_version_range": "<= 7.3.1"
58+
}
59+
}
60+
],
61+
"references": [
62+
{
63+
"type": "WEB",
64+
"url": "https://github.com/vitejs/vite/security/advisories/GHSA-v2wj-q39q-566r"
65+
},
66+
{
67+
"type": "WEB",
68+
"url": "https://github.com/vitejs/vite/pull/22160"
69+
},
70+
{
71+
"type": "WEB",
72+
"url": "https://github.com/vitejs/vite/commit/a9a3df299378d9cbc5f069e3536a369f8188c8ff"
73+
},
74+
{
75+
"type": "PACKAGE",
76+
"url": "https://github.com/vitejs/vite"
77+
},
78+
{
79+
"type": "WEB",
80+
"url": "https://github.com/vitejs/vite/releases/tag/v7.3.2"
81+
},
82+
{
83+
"type": "WEB",
84+
"url": "https://github.com/vitejs/vite/releases/tag/v8.0.5"
85+
}
86+
],
87+
"database_specific": {
88+
"cwe_ids": [
89+
"CWE-180",
90+
"CWE-284"
91+
],
92+
"severity": "HIGH",
93+
"github_reviewed": true,
94+
"github_reviewed_at": "2026-04-06T18:03:32Z",
95+
"nvd_published_at": null
96+
}
97+
}

0 commit comments

Comments
 (0)