CVE-2025-58751
Vite middleware may serve files starting with the same name with the public directory
Vite is a frontend tooling framework for JavaScript. Prior to versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20, files starting with the same name with the public directory were served bypassing the server.fs settings. Only apps that explicitly expose the Vite dev server to the network (using --host or server.host config option), use the public directory feature (enabled by default), and have a symlink in the public directory are affected. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- Low
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
2.3
Vite middleware may serve files starting with the same name with the public directory
Vite is a frontend tooling framework for JavaScript. Prior to versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20, files starting with the same name with the public directory were served bypassing the server.fs settings. Only apps that explicitly expose the Vite dev server to the network (using --host or server.host config option), use the public directory feature (enabled by default), and have a symlink in the public directory are affected. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue.
- Record
CVE-2025-58751- CVSS 4.0
- 2.3 Low
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-22, CWE-200, CWE-284
- Updated
- 2026-11-02
EUVDEUVD-2025-27181
2.3
Vite is a frontend tooling framework for JavaScript. Prior to versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20, files starting with the same name with the public directory were served bypassing the server.fs settings. Only apps that explicitly expose the Vite dev server to the network (using --host or server.host config option), use the public directory feature (enabled by default), and have a symlink in the public directory are affected. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue.
- Record
EUVD-2025-27181- CVSS 4.0
- 2.3 Low
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-g4jq-h2w9-997c
2.3
Vite middleware may serve files starting with the same name with the public directory
Summary
Files starting with the same name with the public directory were served bypassing the server.fs settings.
Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using --host or
server.hostconfig option) - uses the public directory feature (enabled by default)
- a symlink exists in the public directory
Details
The servePublicMiddleware function is in charge of serving public files from the server. It returns the viteServePublicMiddleware function which runs the needed tests and serves the page. The viteServePublicMiddleware function checks if the publicFiles variable is defined, and then uses it to determine if the requested page is public. In the case that the publicFiles is undefined, the code will treat the requested page as a public page, and go on with the serving function. publicFiles may be undefined if there is a symbolic link anywhere inside the public directory. In that case, every requested page will be passed to the public serving function. The serving function is based on the sirv library. Vite patches the library to add the possibility to test loading access to pages, but when the public page middleware disables this functionality since public pages are meant to be available always, regardless of whether they are in the allow or deny list.
In the case of public pages, the serving function is provided with the path to the public directory as a root directory. The code of the sirv library uses the join function to get the full path to the requested file. For example, if the public directory is "/www/public", and the requested file is "myfile", the code will join them to the string "/www/public/myfile". The code will then pass this string to the normalize function. Afterwards, the code will use the string's startsWith function to determine whether the created path is within the given directory or not. Only if it is, it will be served.
Since sirv trims the trailing slash of the public directory, the string's startsWith function may return true even if the created path is not within the public directory. For example, if the server's root is at "/www", and the public directory is at "/www/p", if the created path will be "/www/private.txt", the startsWith function will still return true, because the string "/www/private.txt" starts with "/www/p". To achieve this, the attacker will use ".." to ask for the file "../private.txt". The code will then join it to the "/www/p" string, and will receive "/www/p/../private.txt". Then, the normalize function will return "/www/private.txt", which will then be passed to the startsWith function, which will return true, and the…
- Record
GHSA-g4jq-h2w9-997c- CVSS 4.0
- 2.3 Low
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-22, CWE-200, CWE-284
- Updated
- 2026-11-02
NVD
2.3
Vite is a frontend tooling framework for JavaScript. Prior to versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20, files starting with the same name with the public directory were served bypassing the server.fs settings. Only apps that explicitly expose the Vite dev server to the network (using --host or server.host config option), use the public directory feature (enabled by default), and have a symlink in the public directory are affected. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue.
- Record
CVE-2025-58751- CVSS 4.0
- 2.3 Low
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Weakness
- CWE-22, CWE-200, CWE-284
- Updated
- 2026-11-02
OSV
2.3
Vite middleware may serve files starting with the same name with the public directory
Vite is a frontend tooling framework for JavaScript. Prior to versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20, files starting with the same name with the public directory were served bypassing the server.fs settings. Only apps that explicitly expose the Vite dev server to the network (using --host or server.host config option), use the public directory feature (enabled by default), and have a symlink in the public directory are affected. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue.
- Record
CVE-2025-58751- CVSS 4.0
- 2.3 Low
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-200, CWE-22, CWE-284
- Updated
- 2026-11-04
OSVGHSA-g4jq-h2w9-997c
2.3
Vite middleware may serve files starting with the same name with the public directory
Summary
Files starting with the same name with the public directory were served bypassing the server.fs settings.
Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using --host or
server.hostconfig option) - uses the public directory feature (enabled by default)
- a symlink exists in the public directory
Details
The servePublicMiddleware function is in charge of serving public files from the server. It returns the viteServePublicMiddleware function which runs the needed tests and serves the page. The viteServePublicMiddleware function checks if the publicFiles variable is defined, and then uses it to determine if the requested page is public. In the case that the publicFiles is undefined, the code will treat the requested page as a public page, and go on with the serving function. publicFiles may be undefined if there is a symbolic link anywhere inside the public directory. In that case, every requested page will be passed to the public serving function. The serving function is based on the sirv library. Vite patches the library to add the possibility to test loading access to pages, but when the public page middleware disables this functionality since public pages are meant to be available always, regardless of whether they are in the allow or deny list.
In the case of public pages, the serving function is provided with the path to the public directory as a root directory. The code of the sirv library uses the join function to get the full path to the requested file. For example, if the public directory is "/www/public", and the requested file is "myfile", the code will join them to the string "/www/public/myfile". The code will then pass this string to the normalize function. Afterwards, the code will use the string's startsWith function to determine whether the created path is within the given directory or not. Only if it is, it will be served.
Since sirv trims the trailing slash of the public directory, the string's startsWith function may return true even if the created path is not within the public directory. For example, if the server's root is at "/www", and the public directory is at "/www/p", if the created path will be "/www/private.txt", the startsWith function will still return true, because the string "/www/private.txt" starts with "/www/p". To achieve this, the attacker will use ".." to ask for the file "../private.txt". The code will then join it to the "/www/p" string, and will receive "/www/p/../private.txt". Then, the normalize function will return "/www/private.txt", which will then be passed to the startsWith function, which will return true, and the…
- Record
GHSA-g4jq-h2w9-997c- CVSS 4.0
- 2.3 Low
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N - Weakness
- CWE-200, CWE-22, CWE-284
- Updated
- 2026-11-02
Show 14 moreShow less
OSVROOT-APP-NPM-CVE-2025-58751
5.3
CVE-2025-58751 in @rootio/vite - Patched by Root
Root has patched CVE-2025-58751 in the @rootio/vite package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2025-58751- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Updated
- 2026-11-02
OSVCLSA-2026-1777249675 No score
TuxCare security update for vite (4 CVEs)
TuxCare rebuilt vite to address 4 CVEs. Fixed in 5.4.14-tuxcare.2.
- Record
CLSA-2026-1777249675- Updated
- 2026-11-02
OSVCLSA-2026-1777509608 No score
TuxCare security update for vite (11 CVEs)
TuxCare rebuilt vite to address 11 CVEs. Fixed in 2.9.18-tuxcare.1.
- Record
CLSA-2026-1777509608- Updated
- 2026-11-02
OSVCLSA-2026-1777855413 No score
TuxCare security update for vite (4 CVEs)
TuxCare rebuilt vite to address 4 CVEs. Fixed in 3.2.11-tuxcare.2.
- Record
CLSA-2026-1777855413- Updated
- 2026-11-02
OSVCLSA-2026-1777855416 No score
TuxCare security update for vite (4 CVEs)
TuxCare rebuilt vite to address 4 CVEs. Fixed in 4.5.14-tuxcare.1.
- Record
CLSA-2026-1777855416- Updated
- 2026-11-02
OSVCLSA-2026-1786362148 No score
TuxCare security update for vite (3 CVEs)
TuxCare rebuilt vite to address 3 CVEs. Fixed in 4.5.5-tuxcare.9.
- Record
CLSA-2026-1786362148- Updated
- 2026-11-02
OSVCLSA-2026-1789031855 No score
TuxCare security update for vite (16 CVEs)
TuxCare rebuilt vite to address 16 CVEs. Fixed in 4.1.5-tuxcare.1.
- Record
CLSA-2026-1789031855- Updated
- 2026-11-02
OSVCLSA-2026-1791897792 No score
TuxCare security update for vite (8 CVEs)
TuxCare rebuilt vite to address 8 CVEs. Fixed in 5.4.10-tuxcare.4.
- Record
CLSA-2026-1791897792- Updated
- 2026-11-02
OSVCLSA-2026-1792161547 No score
TuxCare security update for @astrojs/internal-helpers (2 CVEs)
TuxCare rebuilt @astrojs/internal-helpers to address 2 CVEs. Fixed in 5.18.1-tuxcare.2.
- Record
CLSA-2026-1792161547- Updated
- 2026-11-02
OSVCLSA-2026-1792161687 No score
TuxCare security update for @astrojs/prism (2 CVEs)
TuxCare rebuilt @astrojs/prism to address 2 CVEs. Fixed in 5.18.1-tuxcare.2.
- Record
CLSA-2026-1792161687- Updated
- 2026-11-02
OSVCLSA-2026-1792161778 No score
TuxCare security update for @astrojs/underscore-redirects (2 CVEs)
TuxCare rebuilt @astrojs/underscore-redirects to address 2 CVEs. Fixed in 5.18.1-tuxcare.2.
- Record
CLSA-2026-1792161778- Updated
- 2026-11-02
OSVCLSA-2026-1792161849 No score
TuxCare security update for @astrojs/upgrade (2 CVEs)
TuxCare rebuilt @astrojs/upgrade to address 2 CVEs. Fixed in 5.18.1-tuxcare.2.
- Record
CLSA-2026-1792161849- Updated
- 2026-11-02
OSVCLSA-2026-1792225950 No score
TuxCare security update for @vitejs/plugin-react (11 CVEs)
TuxCare rebuilt @vitejs/plugin-react to address 11 CVEs. Fixed in 2.9.18-tuxcare.1.
- Record
CLSA-2026-1792225950- Updated
- 2026-11-02
OSVCLSA-2026-1792225951 No score
TuxCare security update for @vitejs/plugin-react (4 CVEs)
TuxCare rebuilt @vitejs/plugin-react to address 4 CVEs. Fixed in 3.2.11-tuxcare.2.
- Record
CLSA-2026-1792225951- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
vitenpm |
7.1.0 to 7.1.4 | 7.1.5 |
vitenpm |
7.0.0 to 7.0.6 | 7.0.7 |
vitenpm |
6.0.0 to 6.3.5 | 6.3.6 |
vitenpm |
through 5.4.19 | 5.4.20 |
viteTuxCare:npm From an advisory covering 4 CVEs |
5.4.14-tuxcare.0 up to 5.4.14-tuxcare.2, plus listed versions 5.4.145.4.14-tuxcare.1 |
5.4.14-tuxcare.2 |
viteTuxCare:npm From an advisory covering 11 CVEs |
2.9.18-tuxcare.0 up to 2.9.18-tuxcare.1, plus listed versions 2.9.18 |
2.9.18-tuxcare.1 |
viteTuxCare:npm From an advisory covering 4 CVEs |
3.2.11-tuxcare.0 up to 3.2.11-tuxcare.2, plus listed versions 3.2.113.2.11-tuxcare.1 |
3.2.11-tuxcare.2 |
viteTuxCare:npm From an advisory covering 4 CVEs |
4.5.14-tuxcare.0 up to 4.5.14-tuxcare.1, plus listed versions 4.5.14 |
4.5.14-tuxcare.1 |
viteTuxCare:npm From an advisory covering 3 CVEs |
4.5.5-tuxcare.0 up to 4.5.5-tuxcare.9, plus listed versions 4.5.54.5.5-tuxcare.14.5.5-tuxcare.24.5.5-tuxcare.34.5.5-tuxcare.4 Show 4 moreShow less4.5.5-tuxcare.54.5.5-tuxcare.64.5.5-tuxcare.74.5.5-tuxcare.8 |
4.5.5-tuxcare.9 |
viteTuxCare:npm From an advisory covering 16 CVEs |
4.1.5-tuxcare.0 up to 4.1.5-tuxcare.1, plus listed versions 4.1.5 |
4.1.5-tuxcare.1 |
Show 13 moreShow less
| Package | Affected | Fixed |
|---|---|---|
viteTuxCare:npm From an advisory covering 8 CVEs |
5.4.10-tuxcare.0 up to 5.4.10-tuxcare.4, plus listed versions 5.4.105.4.10-tuxcare.15.4.10-tuxcare.25.4.10-tuxcare.3 |
5.4.10-tuxcare.4 |
@astrojs/internal-helpersTuxCare:npm From an advisory covering 2 CVEs |
5.18.1-tuxcare.0 up to 5.18.1-tuxcare.2, plus listed versions 5.18.1 |
5.18.1-tuxcare.2 |
@astrojs/prismTuxCare:npm From an advisory covering 2 CVEs |
5.18.1-tuxcare.0 up to 5.18.1-tuxcare.2, plus listed versions 5.18.1 |
5.18.1-tuxcare.2 |
@astrojs/underscore-redirectsTuxCare:npm From an advisory covering 2 CVEs |
5.18.1-tuxcare.0 up to 5.18.1-tuxcare.2, plus listed versions 5.18.1 |
5.18.1-tuxcare.2 |
@astrojs/upgradeTuxCare:npm From an advisory covering 2 CVEs |
5.18.1-tuxcare.0 up to 5.18.1-tuxcare.2, plus listed versions 5.18.1 |
5.18.1-tuxcare.2 |
@vitejs/plugin-reactTuxCare:npm From an advisory covering 11 CVEs |
2.9.18-tuxcare.0 up to 2.9.18-tuxcare.1, plus listed versions 2.9.18 |
2.9.18-tuxcare.1 |
@vitejs/plugin-reactTuxCare:npm From an advisory covering 4 CVEs |
3.2.11-tuxcare.0 up to 3.2.11-tuxcare.2, plus listed versions 3.2.113.2.11-tuxcare.1 |
3.2.11-tuxcare.2 |
vitenpm |
7.1.0 up to 7.1.5 | 7.1.5 |
vitenpm |
7.0.0 up to 7.0.7 | 7.0.7 |
vitenpm |
6.0.0 up to 6.3.6 | 6.3.6 |
vitenpm |
before 5.4.20 | 5.4.20 |
@rootio/viteRoot:npm |
before 7.1.4-root.io.1 | 7.1.4-root.io.17.1.4-root.io.27.1.4-root.io.37.1.4-root.io.4 |
viteRoot:npm |
before 7.1.4-aikido.3 | 7.1.4-aikido.37.1.4-aikido.4 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| Nuclei | Vite Dev Server - Path Traversal |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, Nuclei, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-58751 is a low vulnerability (CVSS 2.3) in Vitejs Vite, published September 8, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.21%, the 68th percentile. Fixed in vite 7.1.5.
References
github.com/vitejs/vite/security/advisories/GHSA-g4jq-h2w9-997c
github.com/lukeed/sirv/commit/f0113f3f8266328d804ee808f763a3c11f8997eb
github.com/vitejs/vite/commit/09f2b52e8d5907f26602653caf41b3a56692600d
github.com/vitejs/vite/commit/4f1c35bcbb5830290c694aa14b6789e07450f069
github.com/vitejs/vite/commit/63e2a5d232218f3f8d852056751e609a5367aaec
github.com/vitejs/vite/commit/e11d24008b97d4ca731ecc1a3b95260a6d12e7e0
Left out here: the rest of 2 source descriptions. The JSON record has them.