{"answers":{"affected":"10 open source packages ship an affected version, including vite. It affects 1 product.","exploited":"Yes. Attackers have exploited CVE-2025-31125 in the wild since at least 22 Jan 2026.","fix":"Upgrade vite to a fixed version for your release line: 4.5.11, 5.4.16, 6.0.13 or 6.1.3. US federal agencies must fix it by 12 Feb 2026.","what":"CVE-2025-31125 is a medium-severity path traversal vulnerability in vitejs vite, published on 31 Mar 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2025-31125 and fix it if it is affected.\n\nWhat it is: CVE-2025-31125 is a medium-severity path traversal vulnerability in vitejs vite, published on 31 Mar 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: Yes. Attackers have exploited CVE-2025-31125 in the wild since at least 22 Jan 2026.\n\nAffected packages and fixed versions:\n- vite (npm): affected all versions; fixed in 4.5.11\n- vite (npm): affected all versions; fixed in 4.5.11\n- vite (npm): affected from 5.0.0; fixed in 5.4.16\n- vite (npm): affected from 5.0.0; fixed in 5.4.16\n- vite (npm): affected from 6.0.0; fixed in 6.0.13\n- vite (npm): affected from 6.0.0; fixed in 6.0.13\n- vite (npm): affected from 6.1.0; fixed in 6.1.3\n- vite (npm): affected from 6.1.0; fixed in 6.1.3\n- vite (npm): affected from 6.2.0; fixed in 6.2.4\n- vite (npm): affected from 6.2.0; fixed in 6.2.4\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-31125/ (Markdown: https://insights.sbomify.com/CVE-2025-31125/index.md)","id":"CVE-2025-31125","markdown":"https://insights.sbomify.com/CVE-2025-31125/index.md","name":"CVE-2025-31125","record":{"aliases":["GHSA-4r4m-qw57-chr8","MINI-qj5j-42h3-7rfg"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":true,"product_category":"Vite frontend tooling","requires_auth":"none","summary":"Attackers can bypass file access restrictions to read sensitive files if the Vite dev server is exposed to the network.","user_interaction":"required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"vite","vendor":"vitejs"}],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-284","name":"Improper Access Control"},{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"description":"Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline\u0026import 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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":"2025-04-01","github_poc":4,"max_poc_stars":6,"metasploit":0,"nuclei":1,"refs":[{"date":"2025-04-01T14:24:44Z","kind":"github_poc","ref":"https://github.com/sunhuiHi666/CVE-2025-31125","stars":6,"title":"Vite 任意文件读取漏洞POC"},{"date":"2025-05-03T18:41:42Z","kind":"github_poc","ref":"https://github.com/MuhammadWaseem29/Vitejs-exploit","stars":0,"title":" Vite Development Server's @fs endpoint (CVE-2025-31125) to access sensitive files like /etc/passwd and /etc/hosts via crafted URLs."},{"date":"2025-05-07T07:45:10Z","kind":"github_poc","ref":"https://github.com/0xgh057r3c0n/CVE-2025-31125","stars":0,"title":"Vite WASM Import Path Traversal 🛡️"},{"date":"2025-07-13T16:42:41Z","kind":"github_poc","ref":"https://github.com/harshgupptaa/Path-Transversal-CVE-2025-31125-","stars":0,"title":"Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline\u0026import 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."},{"date":null,"kind":"nuclei","ref":"http/cves/2025/CVE-2025-31125.yaml","stars":null,"title":"Vite Development Server - Path Traversal"}],"tier":"exploited"},"has_fix":true,"headline":"Vite Vitejs Improper Access Control","id":"CVE-2025-31125","indexable":true,"kev":{"dateAdded":"2026-01-22","dueDate":"2026-02-12","knownRansomwareCampaignUse":"Unknown","product":"Vitejs","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.","vendorProject":"Vite","vulnerabilityName":"Vite Vitejs Improper Access Control Vulnerability"},"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"path_traversal","year":"2025"},"n_packages":10,"n_references":2,"next":{"headline":"Element X iOS allows the entity in control of the well-known file to break the confidentiality of embedded Element Call","id":"CVE-2025-31126"},"packages":[{"ecosystem":"npm","fixed":["4.5.11"],"introduced":["0"],"last_affected":[],"package":"vite","purl":null,"source":"GHSA-4r4m-qw57-chr8"},{"ecosystem":"npm","fixed":["4.5.11"],"introduced":["0"],"last_affected":[],"package":"vite","purl":"pkg:npm/vite","source":"GHSA-4r4m-qw57-chr8"},{"ecosystem":"npm","fixed":["5.4.16"],"introduced":["5.0.0"],"last_affected":[],"package":"vite","purl":null,"source":"GHSA-4r4m-qw57-chr8"},{"ecosystem":"npm","fixed":["5.4.16"],"introduced":["5.0.0"],"last_affected":[],"package":"vite","purl":"pkg:npm/vite","source":"GHSA-4r4m-qw57-chr8"},{"ecosystem":"npm","fixed":["6.0.13"],"introduced":["6.0.0"],"last_affected":[],"package":"vite","purl":null,"source":"GHSA-4r4m-qw57-chr8"},{"ecosystem":"npm","fixed":["6.0.13"],"introduced":["6.0.0"],"last_affected":[],"package":"vite","purl":"pkg:npm/vite","source":"GHSA-4r4m-qw57-chr8"},{"ecosystem":"npm","fixed":["6.1.3"],"introduced":["6.1.0"],"last_affected":[],"package":"vite","purl":null,"source":"GHSA-4r4m-qw57-chr8"},{"ecosystem":"npm","fixed":["6.1.3"],"introduced":["6.1.0"],"last_affected":[],"package":"vite","purl":"pkg:npm/vite","source":"GHSA-4r4m-qw57-chr8"},{"ecosystem":"npm","fixed":["6.2.4"],"introduced":["6.2.0"],"last_affected":[],"package":"vite","purl":null,"source":"GHSA-4r4m-qw57-chr8"},{"ecosystem":"npm","fixed":["6.2.4"],"introduced":["6.2.0"],"last_affected":[],"package":"vite","purl":"pkg:npm/vite","source":"GHSA-4r4m-qw57-chr8"}],"prev":{"headline":"Zitadel allows User Enumeration by loginname attribute normalization","id":"CVE-2025-31124"},"products":["vite"],"published":"2025-03-31","related":[{"cvss_score":8.2,"headline":"Vite: `server.fs.deny` bypass on Windows alternate paths","id":"CVE-2026-53571","kev_date_added":null,"published":"2026-06-22"},{"cvss_score":8.2,"headline":"Vite Affected by Arbitrary File Read via Vite Dev Server WebSocket","id":"CVE-2026-39363","kev_date_added":null,"published":"2026-04-07"},{"cvss_score":8.2,"headline":"Vite has a `server.fs.deny` bypass with queries","id":"CVE-2026-39364","kev_date_added":null,"published":"2026-04-07"},{"cvss_score":7.5,"headline":"Vite dev server option `server.fs.deny` can be bypassed when hosted on case-insensitive filesystem","id":"CVE-2024-23331","kev_date_added":null,"published":"2024-01-19"},{"cvss_score":7.5,"headline":"Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//)","id":"CVE-2023-34092","kev_date_added":null,"published":"2023-06-01"},{"cvss_score":6.5,"headline":"Vite allows any websites to send any requests to the development server and read the response","id":"CVE-2025-24010","kev_date_added":null,"published":"2025-01-20"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"open","licence":"CC0 1.0","name":"CISA KEV"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"attribution","licence":"MIT","name":"Nuclei templates"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"active","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-01-23","vendors":["vitejs"]},"summary":"Attackers can bypass file access restrictions to read sensitive files if the Vite dev server is exposed to the network.","url":"https://insights.sbomify.com/CVE-2025-31125/"}