{"id":"CVE-2024-31207","aliases":["CVE-2024-31207","GHSA-8jhw-289h-jh2g"],"related":[],"kind":"vulnerability","state":"published","title":"Vite's `server.fs.deny` did not deny requests for patterns with directories","summary":"Vite (French word for \"quick\", pronounced /vit/, like \"veet\") is a frontend build tooling to improve the frontend development experience.`server.fs.deny` does not deny requests for patterns with directories. This vulnerability has been patched in version(s) 5.2.6, 5.1.7, 5.0.13, 4.5.3, 3.2.10 and 2.9.18.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Vite (French word for \"quick\", pronounced /vit/, like \"veet\") is a frontend build tooling to improve the frontend development experience.`server.fs.deny` does not deny requests for patterns with directories. This vulnerability has been patched in version(s) 5.2.6, 5.1.7, 5.0.13, 4.5.3, 3.2.10 and 2.9.18.","source":"cvelist"},{"lang":"en","text":"### Summary\n[Vite dev server option](https://vitejs.dev/config/server-options.html#server-fs-deny) `server.fs.deny` did not deny requests for patterns with directories. An example of such a pattern is `/foo/**/*`.\n\n### Impact\nOnly 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](https://vitejs.dev/config/server-options.html#server-host)) are affected.\n\n### Patches\nFixed 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\n\n### Details\n`server.fs.deny` uses picomatch with the config of `{ matchBase: true }`. [matchBase](https://github.com/micromatch/picomatch/blob/master/README.md#options:~:text=Description-,basename,-boolean) 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](https://github.com/micromatch/picomatch/blob/master/README.md#options:~:text=error%20is%20thrown.-,dot,-boolean) unless they are explicitly defined.\n\n**Reproduction**\n\nSet fs.deny to `['**/.git/**']` and then curl for `/.git/config`.\n\n* with `matchBase: true`, you can get any file under  `.git/` (config, HEAD, etc).\n* with `matchBase: false`, you cannot get any file under  `.git/` (config, HEAD, etc).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Vite (palabra francesa para \"rápido\", pronunciada /vit/, como \"veet\") es una herramienta de construcción de frontend para mejorar la experiencia de desarrollo de frontend. `server.fs.deny` no niega solicitudes de patrones con directorios. Esta vulnerabilidad ha sido parcheada en las versiones 5.2.6, 5.1.7, 5.0.13, 4.5.3, 3.2.10 y 2.9.18.","source":"nvd"}],"published":"2024-04-03T16:46:17.000Z","modified":"2026-09-10T03:50:12.501Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-200","CWE-284"],"affected":[{"ranges":[{"version":">= 2.7.0, <= 2.9.17","status":"affected"},{"version":">= 3.0.0, <= 3.2.8","status":"affected"},{"version":">= 4.0.0, <= 4.5.2","status":"affected"},{"version":">= 5.0.0, <= 5.0.12","status":"affected"},{"version":">= 5.1.0, <= 5.1.6","status":"affected"},{"version":">= 5.2.0, <= 5.2.5","status":"affected"}],"vendor":"vitejs","product":"vite","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.7.0","status":"affected","fixed":"2.9.18"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"3.0.0","status":"affected","fixed":"3.2.10"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"4.5.3"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"5.0.0","status":"affected","fixed":"5.0.13"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"5.1.0","status":"affected","fixed":"5.1.7"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"5.2.0","status":"affected","fixed":"5.2.6"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"}],"references":[{"url":"https://github.com/vitejs/vite/security/advisories/GHSA-8jhw-289h-jh2g","tags":["web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/vite/commit/011bbca350e447d1b499d242804ce62738c12bc0","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/vite/commit/5a056dd2fc80dbafed033062fe6aaf4717309f48","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/vite/commit/89c7c645f09d16a38f146ef4a1528f218e844d67","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/vite/commit/96a7f3a41ef2f9351c46f3ab12489bb4efa03cc9","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/vite/commit/ba5269cca81de3f5fbb0f49d58a1c55688043258","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/vite/commit/d2db33f7d4b96750b35370c70dd2c35ec3b9b649","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-31207","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-04-04T17:23:36.781Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-31207","url":"https://www.cve.org/CVERecord?id=CVE-2024-31207","licence":"CVE Terms of Use","modified":"2024-08-02T01:46:04.483Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8jhw-289h-jh2g","url":"https://github.com/advisories/GHSA-8jhw-289h-jh2g","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:12.501Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-31207","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-31207","licence":"Public domain","modified":"2026-06-17T07:27:58.913Z"}],"updatedAt":"2026-11-25T22:58:38.765Z","epss":{"score":0.00842,"percentile":0.55314,"date":"2026-11-30T12:00:22.000Z"}}