Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance`
### Summary The first 4 bytes of files outside of `server.fs` setting can be returned to the browser by a request containing `?vite-wasm-instance`. ### Impact Only apps that match one of the following conditions are affected: - explicitly expose the Vite dev server to the network using `--host` or the [`server.host`](https://vite.dev/config/server-options#server-host) option - there's a file that has a sensitive information in **the first 4 bytes** - uses Node.js or Deno to run Vite (if Bun is used, it is not affected) ### Details Requests containing the `?vite-wasm-instance` query are handled by the internal Wasm plugin's `load` hook. The hook removes the query and reads the resulting path directly from disk, but the `server.fs` checks were not applied. After reading the file, Vite attempts to parse it as WebAssembly. When that parse fails, Node and deno throws an error that contains the first 4 bytes of the file. ### PoC Create a denied file and start an affected Vite dev server: ```bash echo 'SECRET_KEY=abc123\n' > .env npm run dev curl 'http://localhost:5173/.env?vite-wasm-instance' ``` This will show ``` Failed to parse WASM file "/.env": WebAssembly.compile(): expected magic word 00 61 73 6d, found 53 45 43 52 @+0 ```
- Products
- vite, vite-plus
- Affected versions
- Not specified
- Fixed versions
- 1.1.0, 8.2.4, 8.3.3
- CVEs
- CVE-2026-112947
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 14:34 UTC · Revision 1
Source evidence
Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance`
core-osv · Original sourcePublished 21 Oct 2026, 16:47 UTC
### Summary The first 4 bytes of files outside of `server.fs` setting can be returned to the browser by a request containing `?vite-wasm-instance`. ### Impact Only apps that match one of the following conditions are affected: - explicitly expose the Vite dev server to the network using `--host` or the [`server.host`](https://vite.dev/config/server-options#server-host) option - there's a file that has a sensitive information in **the first 4 bytes** - uses Node.js or Deno to run Vite (if Bun is used, it is not affected) ### Details Requests containing the `?vite-wasm-instance` query are handled by the internal Wasm plugin's `load` hook. The hook removes the query and reads the resulting path directly from disk, but the `server.fs` checks were not applied. After reading the file, Vite attempts to parse it as WebAssembly. When that parse fails, Node and deno throws an error that contains the first 4 bytes of the file. ### PoC Create a denied file and start an affected Vite dev server: ```bash echo 'SECRET_KEY=abc123\n' > .env npm run dev curl 'http://localhost:5173/.env?vite-wasm-instance' ``` This will show ``` Failed to parse WASM file "/.env": WebAssembly.compile(): expected magic word 00 61 73 6d, found 53 45 43 52 @+0 ```
osv:GHSA-vfpm-58rq-9qcg
vite
Fixed versions: 8.3.3
vite
Fixed versions: 8.2.4
vite-plus
Fixed versions: 1.1.0
Complete source record
{
"id": "f12e695aeda1b35d04e2c0aeb62302a87c810e6a4e52c418f869583f90f2258e",
"url": "https://osv.dev/vulnerability/GHSA-vfpm-58rq-9qcg",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance`",
"summary": "### Summary The first 4 bytes of files outside of `server.fs` setting can be returned to the browser by a request containing `?vite-wasm-instance`. ### Impact Only apps that match one of the following conditions are affected: - explicitly expose the Vite dev server to the network using `--host` or the [`server.host`](https://vite.dev/config/server-options#server-host) option - there's a file that has a sensitive information in **the first 4 bytes** - uses Node.js or Deno to run Vite (if Bun is used, it is not affected) ### Details Requests containing the `?vite-wasm-instance` query are handled by the internal Wasm plugin's `load` hook. The hook removes the query and reads the resulting path directly from disk, but the `server.fs` checks were not applied. After reading the file, Vite attempts to parse it as WebAssembly. When that parse fails, Node and deno throws an error that contains the first 4 bytes of the file. ### PoC Create a denied file and start an affected Vite dev server: ```bash echo 'SECRET_KEY=abc123\\n' > .env npm run dev curl 'http://localhost:5173/.env?vite-wasm-instance' ``` This will show ``` Failed to parse WASM file \"/.env\": WebAssembly.compile(): expected magic word 00 61 73 6d, found 53 45 43 52 @+0 ```",
"evidence": "osv:GHSA-vfpm-58rq-9qcg",
"products": [
{
"name": {
"value": "vite",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "8.3.3",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
},
{
"name": {
"value": "vite",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "8.2.4",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
},
{
"name": {
"value": "vite-plus",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "1.1.0",
"evidence": "/affected/2/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "GHSA-vfpm-58rq-9qcg",
"aliases": [
"CVE-2026-112947",
"GHSA-vfpm-58rq-9qcg"
],
"metrics": [
{
"type": "CVSS_V4",
"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"
}
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "8.3.0"
},
{
"fixed": "8.3.3"
}
]
}
],
"package": {
"name": "vite",
"purl": "pkg:npm/vite",
"ecosystem": "npm"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-vfpm-58rq-9qcg/GHSA-vfpm-58rq-9qcg.json",
"last_known_affected_version_range": "<= 8.3.2"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "8.2.0"
},
{
"fixed": "8.2.4"
}
]
}
],
"package": {
"name": "vite",
"purl": "pkg:npm/vite",
"ecosystem": "npm"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-vfpm-58rq-9qcg/GHSA-vfpm-58rq-9qcg.json",
"last_known_affected_version_range": "<= 8.2.3"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.2.8"
},
{
"fixed": "1.1.0"
}
]
}
],
"package": {
"name": "vite-plus",
"purl": "pkg:npm/vite-plus",
"ecosystem": "npm"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-vfpm-58rq-9qcg/GHSA-vfpm-58rq-9qcg.json",
"last_known_affected_version_range": "<= 1.0.0"
}
}
],
"modified": "2026-10-21T17:00:07.443467820Z",
"provider": "osv",
"references": [
"https://github.com/vitejs/vite/security/advisories/GHSA-vfpm-58rq-9qcg",
"https://nvd.nist.gov/vuln/detail/CVE-2026-112947",
"https://github.com/vitejs/vite/pull/23655",
"https://github.com/vitejs/vite/commit/b6c6d2fb3f853aab4092dc25f0d6816a96c23dff",
"https://github.com/vitejs/vite/commit/ba8b7ab43b4afa5d0292ab4b6e3a7b5033cc9c73",
"https://github.com/vitejs/vite"
],
"provider_metadata": {
"cwe_ids": [
"CWE-200",
"CWE-209",
"CWE-22"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": "2026-10-20T16:17:05Z",
"github_reviewed_at": "2026-10-21T16:47:15Z"
}
},
"related_cves": [
{
"value": "CVE-2026-112947",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 394548,
"published_at": "2026-10-21T16:47:15+00:00"
}