CVE-2025-31125: Vite Vitejs Improper Access Control Vulnerability

Published Mar 31, 2025
·
Updated

### Summary The contents of arbitrary files can be returned to the browser. ### Impact Only 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. ### Details - base64 encoded content of non-allowed files is exposed using `?inline&import` (originally reported as `?import&?inline=1.wasm?init`) - content of non-allowed files is exposed using `?raw?import` `/@fs/` isn't needed to reproduce the issue for files inside the project root. ### PoC Original report (check details above for simplified cases): The ?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 ``` $ npm create vite@latest $ cd vite-project/ $ npm install $ npm run dev ``` Example full URL `http://localhost:5173/@fs/C:/windows/win.ini?import&?inline=1.wasm?init`

Affected Software

17 affected componentsFixes available
Vite Vite<6.2.4
Vite Vite<6.1.3
Vite Vite<6.0.13
Vite Vite<5.4.16
Vite Vite<4.5.11
npm/vite<4.5.11
4.5.11
npm/vite>=5.0.0<5.4.16
5.4.16
npm/vite>=6.0.0<6.0.13
6.0.13
npm/vite>=6.1.0<6.1.3
6.1.3
npm/vite>=6.2.0<6.2.4
6.2.4
IBM Concert Software<=1.0.0-1.1.0
vitejs Vite Node.js<4.5.11
vitejs Vite Node.js>=5.0.0<5.4.16
vitejs Vite Node.js>=6.0.0<6.0.13
vitejs Vite Node.js>=6.1.0<6.1.3
vitejs Vite Node.js>=6.2.0<6.2.4
Vite Vitejs

Remediation

Information

Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.

Event History

Mar 31, 2025
CVE Published
via MITRE·05:06 PM
Data Sourced
via MITRE·05:06 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·05:31 PM
Aug 18, 2025
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Jan 22, 2026
Known Exploited
via CISA·12:00 AM
Data Sourced
via CISA·12:00 AM
RemedyDescriptionAffected Software
Jan 23, 2026
News Published
via BleepingComputer·06:47 PM
News Published
via BleepingComputer·06:48 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-31125?

CVE-2025-31125 is considered a moderate severity vulnerability due to its potential exposure of sensitive files.

2

How do I fix CVE-2025-31125?

To fix CVE-2025-31125, upgrade to Vite version 6.2.4 or higher, ensuring your development server is not exposed to the network.

3

Which versions of Vite are affected by CVE-2025-31125?

CVE-2025-31125 affects Vite versions 6.2.4 and below, as well as all earlier versions.

4

What kind of files can be exposed due to CVE-2025-31125?

CVE-2025-31125 can expose content from non-allowed files when certain query parameters are used.

5

Who is affected by CVE-2025-31125?

Applications that explicitly expose the Vite development server to the network using the --host option or server.host config are affected by CVE-2025-31125.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203