GHSA-859w-5945-r5v3

Suggest an improvement
Source
https://github.com/advisories/GHSA-859w-5945-r5v3
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/04/GHSA-859w-5945-r5v3/GHSA-859w-5945-r5v3.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-859w-5945-r5v3
Aliases
  • CVE-2025-46565
Published
2025-04-30T17:40:27Z
Modified
2025-05-02T15:33:47Z
Severity
  • 6.0 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N CVSS Calculator
Summary
Vite's server.fs.deny bypassed with /. for files under project root
Details

Summary

The contents of files in the project root that are denied by a file matching pattern can be returned to the browser.

Impact

Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. Only files that are under project root and are denied by a file matching pattern can be bypassed.

  • Examples of file matching patterns: .env, .env.*, *.{crt,pem}, **/.env
  • Examples of other patterns: **/.git/**, .git/**, .git/**/*

Details

server.fs.deny can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns). These patterns were able to bypass for files under root by using a combination of slash and dot (/.).

PoC

npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env/. http://localhost:5173

image image

Database specific
{
    "nvd_published_at": "2025-05-01T18:15:57Z",
    "cwe_ids": [
        "CWE-22"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2025-04-30T17:40:27Z"
}
References

Affected packages

npm / vite

Package

Affected ranges

Type
SEMVER
Events
Introduced
6.3.0
Fixed
6.3.4

Database specific

{
    "last_known_affected_version_range": "<= 6.3.3"
}

npm / vite

Package

Affected ranges

Type
SEMVER
Events
Introduced
6.2.0
Fixed
6.2.7

Database specific

{
    "last_known_affected_version_range": "<= 6.2.6"
}

npm / vite

Package

Affected ranges

Type
SEMVER
Events
Introduced
6.0.0
Fixed
6.1.6

Database specific

{
    "last_known_affected_version_range": "<= 6.1.5"
}

npm / vite

Package

Affected ranges

Type
SEMVER
Events
Introduced
5.0.0
Fixed
5.4.19

Database specific

{
    "last_known_affected_version_range": "<= 5.4.18"
}

npm / vite

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.5.14

Database specific

{
    "last_known_affected_version_range": "<= 4.5.13"
}