Skip to content

GHSA-8g5g-mxqh-grgj CVE-2026-118662

Vite: `server.fs.deny` bypassed with queries

Medium npm
Severity
6.9 / 10
Medium · CVSS 4.0
Exploit chance (EPSS)
0.29%
Chance of exploitation in the next 30 days. Higher than 22.15% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-180 Incorrect Behavior Order: Validate Before Canonicalize
CWE-284 Improper Access Control
Fix
6.4.5
Upgrade vite to this version or later

Description

Summary

The contents of files that are specified by server.fs.deny can be returned to the browser. This is the same as https://github.com/vitejs/vite/security/advisories/GHSA-v2wj-q39q-566r.

Impact

Only apps that match the following conditions are affected:

Details

On the Vite dev server, files that should be blocked by server.fs.deny (e.g., .env, *.crt) can be retrieved with HTTP 200 responses when query parameters such as ?raw, ?import&raw, or ?import&url&inline are appended.

For the fix for https://github.com/vitejs/vite/security/advisories/GHSA-rq7h-c2jc-7f22, v6.4.4 back-ported https://github.com/vitejs/vite/pull/20410. But while that PR requires https://github.com/vitejs/vite/pull/22160 for https://github.com/vitejs/vite/security/advisories/GHSA-v2wj-q39q-566r, https://github.com/vitejs/vite/pull/22160 wasn't back-ported together causing v6 vulnerable to https://github.com/vitejs/vite/security/advisories/GHSA-v2wj-q39q-566r.

Affected versions

npm

PackageVulnerableFixed in
vite 1 listed versions No fix yet
vite
>= 6.4.4, < 6.4.5
6.4.5

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

vite npm → 6.4.5

npm
npm install vite@6.4.5
yarn
yarn add vite@6.4.5
pnpm
pnpm add vite@6.4.5

Severity breakdown

CVSS 4.0 6.9

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:H/SI:N/SA:N

Attack vector
Network
Attack complexity
Low
Attack requirements
Present
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
Low
Integrity (vulnerable system)
None
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
High
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

Weakness

CWE-180: Incorrect Behavior Order: Validate Before Canonicalize

The product validates input before it is canonicalized, which prevents the product from detecting data that becomes invalid after the canonicalization step.

How to prevent it
  • Implementation: Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

CWE-284: Improper Access Control

The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.

How to prevent it
  • Architecture and Design, Operation: Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
  • Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-4r4m-qw57-chr8
Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query
High Known exploited Also affects vite
GHSA-vfpm-58rq-9qcg
Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance`
Medium Also affects vite
GHSA-rq7h-c2jc-7f22
Vite: Files outside `server.fs.allow` could be served when project paths match system paths on non-Windows machine
Medium Also affects vite
GHSA-9jrq-w75r-8gcw
Vite: Cross origin script execution through Vite custom middleware
Low Also affects vite
GHSA-r825-w8mm-5pxw
launch-editor: Editor CLI flag misinterpretation causing arbitrary command execution for some editors
Medium Also affects vite
GHSA-698v-4r3x-3vcv
launch-editor: escapeCmdArgs() omits % escaping on Windows
Medium Also affects vite
GHSA-587h-7wmj-h5pm
launch-editor: `fs.existsSync()` existence check can be bypassed on Windows
High Also affects vite
GHSA-v6wh-96g9-6wx3
launch-editor: NTLMv2 hash disclosure via UNC path handling on Windows
Medium Also affects vite

Credits: Hama1cco

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor