Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS04amh3LTI4OWgtamgyZ84AA6l1

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

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.

Permalink: https://github.com/advisories/GHSA-8jhw-289h-jh2g
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS04amh3LTI4OWgtamgyZ84AA6l1
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 28 days ago
Updated: 27 days ago


CVSS Score: 5.9
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

Identifiers: GHSA-8jhw-289h-jh2g, CVE-2024-31207
References: Repository: https://github.com/vitejs/vite
Blast Radius: 32.8

Affected Packages

npm:vite
Dependent packages: 31,388
Dependent repositories: 363,358
Downloads: 48,679,700 last month
Affected Version Ranges: >= 5.2.0, <= 5.2.5, >= 5.1.0, <= 5.1.6, >= 5.0.0, <= 5.0.12, >= 4.0.0, <= 4.5.2, >= 3.0.0, <= 3.2.8, >= 2.7.0, <= 2.9.17
Fixed in: 5.2.6, 5.1.7, 5.0.13, 4.5.3, 3.2.10, 2.9.18
All affected versions: 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 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