{"id":"CVE-2025-31125","aliases":["CVE-2025-31125","GHSA-4r4m-qw57-chr8"],"related":[],"kind":"vulnerability","state":"published","title":"Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query","summary":"Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe contents of arbitrary files can be returned to the browser.\n\n### Impact\nOnly apps explicitly exposing the Vite dev server to the network (using `--host` or [`server.host` config option](https://vitejs.dev/config/server-options.html#server-host)) are affected.\n\n### Details\n\n- base64 encoded content of non-allowed files is exposed using `?inline&import` (originally reported as `?import&?inline=1.wasm?init`)\n- content of non-allowed files is exposed using `?raw?import`\n\n`/@fs/` isn't needed to reproduce the issue for files inside the project root.\n\n### PoC\n\nOriginal report (check details above for simplified cases):\n\nThe ?import&?inline=1.wasm?init ending allows attackers to read arbitrary files and returns the file content if it exists.  Base64 decoding needs to be performed twice\n```\n$ npm create vite@latest\n$ cd vite-project/\n$ npm install\n$ npm run dev\n```\n\nExample full URL `http://localhost:5173/@fs/C:/windows/win.ini?import&?inline=1.wasm?init`","format":"markdown","source":"ghsa"},{"lang":"es","text":"Vite es un framework de herramientas frontend para JavaScript. Vite expone el contenido de archivos no permitidos mediante ?inline&amp;import o ?raw?import. Solo las aplicaciones que exponen explícitamente el servidor de desarrollo de Vite a la red (mediante la opción de configuración --host o server.host) se ven afectadas. Esta vulnerabilidad está corregida en las versiones 6.2.4, 6.1.3, 6.0.13, 5.4.16 y 4.5.11.","source":"nvd"},{"lang":"en","text":"Vite Vitejs contains an improper access control vulnerability that exposes content of non-allowed files using ?inline&import or ?raw?import. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.","source":"kev"}],"published":"2025-03-31T17:06:30.704Z","modified":"2026-09-10T03:50:56.858Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-200","CWE-284"],"affected":[{"ranges":[{"version":">= 6.2.0, < 6.2.4","status":"affected"},{"version":">= 6.1.0, < 6.1.3","status":"affected"},{"version":">= 6.0.0, < 6.0.13","status":"affected"},{"version":">= 5.0.0, < 5.4.16","status":"affected"},{"version":"< 4.5.11","status":"affected"}],"vendor":"vitejs","product":"vite","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"6.2.0","status":"affected","fixed":"6.2.4"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"6.1.0","status":"affected","fixed":"6.1.3"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"6.0.0","status":"affected","fixed":"6.0.13"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"5.0.0","status":"affected","fixed":"5.4.16"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.5.11"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.5.11"},{"status":"affected","introduced":"5.0.0","fixed":"5.4.16"},{"status":"affected","introduced":"6.0.0","fixed":"6.0.13"},{"status":"affected","introduced":"6.1.0","fixed":"6.1.3"},{"status":"affected","introduced":"6.2.0","fixed":"6.2.4"}],"vendor":"vitejs","product":"vite","cpe":"cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*","source":"nvd"},{"ranges":[],"vendor":"Vite","product":"Vitejs","source":"kev"}],"references":[{"url":"https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/vite/commit/59673137c45ac2bcfad1170d954347c1a17ab949","tags":["kev","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","kev"]},{"url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-31125","tags":["government-resource","us-government-resource","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-31125","tags":["advisory","kev"],"sources":["ghsa","kev"]},{"url":"https://github.com/vitejs/vite","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","kev":{"dateAdded":"2026-01-22","dueDate":"2026-02-12","name":"Vite Vitejs Improper Access Control Vulnerability","requiredAction":"Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.","ransomware":false,"notes":"This vulnerability could affect an open-source component, third-party library, protocol, or proprietary implementation that could be used by different products. For more information, please see: https://github.com/vitejs/vite/commit/59673137c45ac2bcfad1170d954347c1a17ab949 ; https://nvd.nist.gov/vuln/detail/CVE-2025-31125"},"ssvc":{"scorer":"CISA-ADP","exploitation":"active","automatable":"no","technicalImpact":"total","date":"2026-01-23T16:58:33.096Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-31125","url":"https://www.cve.org/CVERecord?id=CVE-2025-31125","licence":"CVE Terms of Use","modified":"2026-01-23T16:58:37.048Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4r4m-qw57-chr8","url":"https://github.com/advisories/GHSA-4r4m-qw57-chr8","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:56.858Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-31125","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-31125","licence":"Public domain","modified":"2026-06-17T09:09:54.040Z"},{"source":"kev","name":"CISA KEV","id":"CVE-2025-31125","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2025-31125","licence":"CC0-1.0","modified":"2026-01-22T00:00:00.000Z"}],"updatedAt":"2026-11-25T22:58:55.742Z","epss":{"score":0.74939,"percentile":0.99509,"date":"2026-12-01T12:00:22.000Z"}}