Skip to content

← Actionable
Medium, CVSS 5.9amended

Vite's server.fs.deny did not deny requests for patterns with directories.

CVE-2024-31207GHSA-8jhw-289h-jh2g

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (vite 5.2.6, 5.1.7, 5.0.13, 4.5.3, 3.2.10, 2.9.18), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • npm vite

    Affected
    >= 2.7.0, <= 2.9.17>= 3.0.0, <= 3.2.8>= 4.0.0, <= 4.5.2>= 5.0.0, <= 5.0.12>= 5.1.0, <= 5.1.6>= 5.2.0, <= 5.2.5
    Fixed in
    3.2.10, 5.0.13, 4.5.3, 5.2.6, 5.1.7, 2.9.18

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
5.9 · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS
  • CVE-2024-31207: 0.71% estimated exploitation activity in the next 30 days; percentile 53.62 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

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 vite@5.2.6, vite@5.1.7, vite@5.0.13, vite@4.5.3, vite@3.2.10, vite@2.9.18 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).…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-8jhw-289h-jh2g

  2. Revision 1 · created ·

    Published from osv record GHSA-8jhw-289h-jh2g

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2024-31207

Advisory: Vite's `server.fs.deny` did not deny requests for patterns with directories.
IDs: CVE-2024-31207, GHSA-8jhw-289h-jh2g
Record: https://patchnext.com/advisories/cve-2024-31207 (revision 2, source checked 26 Oct 2026, 12:30 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 5.9)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: vite 5.2.6, 5.1.7, 5.0.13, 4.5.3, 3.2.10, 2.9.18. A vendor fix does not mean a deployment is fixed.

## Affected components
- npm vite: affected >= 2.7.0, <= 2.9.17; >= 3.0.0, <= 3.2.8; >= 4.0.0, <= 4.5.2; >= 5.0.0, <= 5.0.12; >= 5.1.0, <= 5.1.6; >= 5.2.0, <= 5.2.5; fixed in 3.2.10, 5.0.13, 4.5.3, 5.2.6, 5.1.7, 2.9.18

## Suggested inspection (read-only)
- `npm ls vite --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on vite.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-8jhw-289h-jh2g (OSV record GHSA-8jhw-289h-jh2g lists affected ranges: npm vite >=2.7.0 =3.0.0 =4.0.0 =5.0.0 =5.1.0 =5.2.0 <5.2.6 (fixed))
- Verified: https://github.com/advisories/GHSA-8jhw-289h-jh2g (GitHub-reviewed advisory GHSA-8jhw-289h-jh2g lists affected ranges: npm vite >=2.7.0 =3.0.0 =4.0.0 =5.0.0 =5.1.0 =5.2.0 <=5.2.5)

Commands are suggestions: review each one before running it.

Loading voting…