Skip to content
OpenAdvisories
Medium · 5.3 Scanner template Public exploit CVE-2025-31486 EUVD-2025-9734GHSA-xcj6-pq6g-qj4x

Vite allows server.fs.deny to be bypassed with .svg or relative paths

Published Apr 3, 2025 · Updated Apr 3, 2025 · Assigned by GitHub_M

Description

Vite is a frontend tooling framework for javascript. The contents of arbitrary files can be returned to the browser. By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the server.fs.deny restriction was able to bypass. This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+. 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 4.5.12, 5.4.17, 6.0.14, 6.1.4, and 6.2.5.

Affected products

VendorProductAffectedFixed
vitejs vite < 4.5.12, >=5.0.0, < 5.4.17, >=6.0.0, < 6.0.14, >=6.1.0, < 6.1.4, >=6.2.0, < 6.2.5 —

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 3 repositories

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Automated scanner template

A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.

Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.

Affected packages

EcosystemPackageAffectedFixedRecord
npm vite >= 6.2.0, < 6.2.5 6.2.5 GHSA-xcj6-pq6g-qj4x
npm vite >= 6.1.0, < 6.1.4 6.1.4 GHSA-xcj6-pq6g-qj4x
npm vite >= 6.0.0, < 6.0.14 6.0.14 GHSA-xcj6-pq6g-qj4x
npm vite >= 5.0.0, < 5.4.17 5.4.17 GHSA-xcj6-pq6g-qj4x
npm vite < 4.5.12 4.5.12 GHSA-xcj6-pq6g-qj4x

References