GHSA-8jhw-289h-jh2g
MEDIUMVite's `server.fs.deny` did not deny requests for patterns with directories.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Blast Radius
Weekly download volume for affected packages — a proxy for how broadly this vulnerability is deployed.
vitenpmDescription
Summary
Vite dev server option server.fs.deny did not deny requests for patterns with directories. An example of such a pattern is /foo/**/*.
Impact
Only apps setting a custom server.fs.deny that includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
Patches
Fixed in [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Details
server.fs.deny uses picomatch with the config of { matchBase: true }. matchBase only matches the basename of the file, not the path due to a bug (https://github.com/micromatch/picomatch/issues/89). The vite config docs read like you should be able to set fs.deny to glob with picomatch. Vite also does not set { dot: true } and that causes dotfiles not to be denied unless they are explicitly defined.
Reproduction
Set fs.deny to ['**/.git/**'] and then curl for /.git/config.
- with
matchBase: true, you can get any file under.git/(config, HEAD, etc). - with
matchBase: false, you cannot get any file under.git/(config, HEAD, etc).
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | vite | ≥ 2.7.0&&< 2.9.18 | 2.9.18 |
| 📦npm | vite | ≥ 3.0.0&&< 3.2.10 | 3.2.10 |
| 📦npm | vite | ≥ 4.0.0&&< 4.5.3 | 4.5.3 |
| 📦npm | vite | ≥ 5.0.0&&< 5.0.13 | 5.0.13 |
| 📦npm | vite | ≥ 5.1.0&&< 5.1.7 | 5.1.7 |
| 📦npm | vite | ≥ 5.2.0&&< 5.2.6 | 5.2.6 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for vite. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update vite to 2.9.18 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-8jhw-289h-jh2g is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-8jhw-289h-jh2g is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-8jhw-289h-jh2g. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-8jhw-289h-jh2g in your dependencies?
O3 detects GHSA-8jhw-289h-jh2g across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.