Update dependency vite to v4.5.3 [SECURITY]
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| vite (source) | 4.3.5 -> 4.5.3 |
GitHub Vulnerability Alerts
CVE-2023-34092
The issue involves a security vulnerability in Vite where the server options can be bypassed using a double forward slash (//). This vulnerability poses a potential security risk as it can allow unauthorized access to sensitive directories and files.
Steps to Fix. Update Vite: Ensure that you are using the latest version of Vite. Security issues like this are often fixed in newer releases.\n2. Secure the server configuration: In your vite.config.js file, review and update the server configuration options to restrict access to unauthorized requests or directories.
Impact
Only users explicitly exposing the Vite dev server to the network (using --host or the server.host config option) are affected and only files in the immediate Vite project root folder could be exposed.\n\n### Patches\nFixed in vite@4.3.9, vite@4.2.3, vite@4.1.5, vite@4.0.5 and in the latest minors of the previous two majors, vite@3.2.7 and vite@2.9.16.
Details
Vite serves the application with under the root-path of the project while running on the dev mode. By default, Vite uses the server option fs.deny to protect sensitive files. But using a simple double forward-slash, we can bypass this restriction. \n\n### PoC\n1. Create a new latest project of Vite using any package manager. (here I'm using react and vue templates and pnpm for testing)\n2. Serve the application on dev mode using pnpm run dev.\n3. Directly access the file via url using double forward-slash (//) (e.g: //.env, //.env.local)\n4. The server option fs.deny was successfully bypassed.
Proof Images:
\n
CVE-2024-23331
Summary
Vite dev server option server.fs.deny can be bypassed on case-insensitive file systems using case-augmented versions of filenames. Notably this affects servers hosted on Windows.
This bypass is similar to https://nvd.nist.gov/vuln/detail/CVE-2023-34092 -- with surface area reduced to hosts having case-insensitive filesystems.
Patches
Fixed in [email protected], [email protected], [email protected], [email protected]
Details
Since picomatch defaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible.
See picomatch usage, where nocase is defaulted to false: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632
By requesting raw filesystem paths using augmented casing, the matcher derived from config.server.fs.deny fails to block access to sensitive files.
PoC
Setup
- Created vanilla Vite project using
npm create vite@lateston a Standard Azure hosted Windows 10 instance.-
npm run dev -- --host 0.0.0.0 - Publicly accessible for the time being here: http://20.12.242.81:5173/
-
- Created dummy secret files, e.g.
custom.secretandproduction.pem - Populated
vite.config.jswith
export default { server: { fs: { deny: ['.env', '.env.*', '*.{crt,pem}', 'custom.secret'] } } }
Reproduction
-
curl -s http://20.12.242.81:5173/@​fs//- Descriptive error page reveals absolute filesystem path to project root
-
curl -s http://20.12.242.81:5173/@​fs/C:/Users/darbonzo/Desktop/vite-project/vite.config.js- Discoverable configuration file reveals locations of secrets
-
curl -s http://20.12.242.81:5173/@​fs/C:/Users/darbonzo/Desktop/vite-project/custom.sEcReT- Secrets are directly accessible using case-augmented version of filename
Proof

Impact
Who
- Users with exposed dev servers on environments with case-insensitive filesystems
What
- Files protected by
server.fs.denyare both discoverable, and accessible
CVE-2024-31207
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).
Release Notes
vitejs/vite (vite)
v4.5.3
v4.5.2
Please refer to CHANGELOG.md for details.
v4.5.1
Please refer to CHANGELOG.md for details.
v4.5.0
Please refer to CHANGELOG.md for details.
v4.4.12
Please refer to CHANGELOG.md for details.
v4.4.11
Please refer to CHANGELOG.md for details.
v4.4.10
Please refer to CHANGELOG.md for details.
v4.4.9
- chore: fix eslint warnings (#β14031) (4021a0e), closes #β14031
- chore(deps): update all non-major dependencies (#β13938) (a1b519e), closes #β13938
- fix: dynamic import vars ignored warning (#β14006) (4479431), closes #β14006
- fix(build): silence warn dynamic import module when inlineDynamicImports true (#β13970) (7a77aaf), closes #β13970
- perf: improve build times and memory utilization (#β14016) (9d7d45e), closes #β14016
- perf: replace startsWith with === (#β14005) (f5c1224), closes #β14005
v4.4.8
- fix: modulePreload false (#β13973) (488085d), closes #β13973
- fix: multiple entries with shared css and no JS (#β13962) (89a3db0), closes #β13962
- fix: use file extensions on type imports so they work with
moduleResolution: 'node16'(#β13947) (aeef670), closes #β13947 - fix(css): enhance error message for missing preprocessor dependency (#β11485) (65e5c22), closes #β11485
- fix(esbuild): fix static properties transpile when useDefineForClassFields false (#β13992) (4ca7c13), closes #β13992
- fix(importAnalysis): strip url base before passing as safeModulePaths (#β13712) (1ab06a8), closes #β13712
- fix(importMetaGlob): avoid unnecessary hmr of negative glob (#β13646) (844451c), closes #β13646
- fix(optimizer): avoid double-commit of optimized deps when discovery is disabled (#β13865) (df77991), closes #β13865
- fix(optimizer): enable experimentalDecorators by default (#β13981) (f8a5ffc), closes #β13981
- perf: replace startsWith with === (#β13989) (3aab14e), closes #β13989
- perf: single slash does not need to be replaced (#β13980) (66f522c), closes #β13980
- perf: use Intl.DateTimeFormatter instead of toLocaleTimeString (#β13951) (af53a1d), closes #β13951
- perf: use Intl.NumberFormat instead of toLocaleString (#β13949) (a48bf88), closes #β13949
- perf: use magic-string hires boundary for sourcemaps (#β13971) (b9a8d65), closes #β13971
- chore(reporter): remove unnecessary map (#β13972) (dd9d4c1), closes #β13972
- refactor: add new overload to the type of defineConfig (#β13958) (24c12fe), closes #β13958
v4.4.7
- fix:
optimizeDeps.includenot working with paths inside packages (#β13922) (06e4f57), closes #β13922 - fix: lightningcss fails with html-proxy (#β13776) (6b56094), closes #β13776
- fix: prepend
config.baseto vite/env path (#β13941) (8e6cee8), closes #β13941 - fix(html): support
import.meta.envdefine replacement without quotes (#β13425) (883089c), closes #β13425 - fix(proxy): handle error when proxy itself errors (#β13929) (4848e41), closes #β13929
- chore(eslint): allow type annotations (#β13920) (d1264fd), closes #β13920
v4.4.6
- fix: constrain inject helpers for iife (#β13909) (c89f677), closes #β13909
- fix: display manualChunks warning only when a function is not used (#β13797) (#β13798) (51c271f), closes #β13797 #β13798
- fix: do not append
browserHashon optimized deps during build (#β13906) (0fb2340), closes #β13906 - fix: use Bun's implementation of
wsinstead of the bundled one (#β13901) (049404c), closes #β13901 - feat(client): add guide to press Esc for closing the overlay (#β13896) (da389cc), closes #β13896
v4.4.5
- fix: "EISDIR: illegal operation on a directory, realpath" error on RAβ¦ (#β13655) (6bd5434), closes #β13655
- fix: transform error message add file info (#β13687) (6dca41c), closes #β13687
- fix: warn when publicDir and outDir are nested (#β13742) (4eb3154), closes #β13742
- fix(build): remove warning about ineffective dynamic import from node_modules (#β13884) (33002dd), closes #β13884
- fix(build): style insert order for UMD builds (fix #β13668) (#β13669) (49a1b99), closes #β13668 #β13669
- fix(deps): update all non-major dependencies (#β13872) (975a631), closes #β13872
- fix(types): narrow down the return type of
defineConfig(#β13792) (c971f26), closes #β13792 - chore: fix typos (#β13862) (f54e8da), closes #β13862
- chore: replace
anywithstring(#β13850) (4606fd8), closes #β13850 - chore(deps): update dependency prettier to v3 (#β13759) (5a56941), closes #β13759
- docs: fix build.cssMinify link (#β13840) (8a2a3e1), closes #β13840
v4.4.4
- chore: warning about ssr cjs format removal (#β13827) (4646e9f), closes #β13827
- fix(esbuild): enable experimentalDecorators by default (#β13805) (e8880f0), closes #β13805
- fix(scan): skip tsconfigRaw fallback if tsconfig is set (#β13823) (b6155a1), closes #β13823
- feat(client): close
vite-error-overlaywith Escape key (#β13795) (85bdcda), closes #β13795
v4.4.3
- fix: avoid early error when server is closed in ssr (#β13787) (89d01eb), closes #β13787
- fix(deps): update all non-major dependencies (#β13758) (8ead116), closes #β13758
- fix(server): remove restart guard on restart (#β13789) (2a38ef7), closes #β13789
v4.4.2
v4.4.1
- fix: revert #β13073, use consistent virtual module ID in module graph (#β13734) (f589ac0), closes #β13073 #β13734
- fix: revert import config module as data (#β13731) (b0bfa01), closes #β13731
- chore: changelog notes and clean for 4.4 (#β13728) (3f4e36e), closes #β13728
v4.4.0
Experimental support for Lightning CSS
Starting from Vite 4.4, there is experimental support for Lightning CSS. You can opt into it by adding css.transformer: 'lightningcss' to your config file and install the optional lightningcss dev dependency. If enabled, CSS files will be processed by Lightning CSS instead of PostCSS.
Lightning CSS can also be used as the CSS minifier with build.cssMinify: 'lightningcss'.
See beta docs at the Lighting CSS guide.
esbuild 0.18 update
esbuild 0.18 contains backwards-incompatible changes to esbuild's handling of tsconfig.json files. We think they shouldn't affect Vite users, you can review #β13525 for more information.
Templates for Solid and Qwik in create-vite
New starter templates have been added to create-vite for Solid and Qwik. Try them online at vite.new/solid-ts and vite.new/qwik-ts.
Korean Translation
Vite's docs are now translated to Korean, available at ko.vitejs.dev.
Features
- feat: preview mode add keyboard shortcuts (#β12968) (126e93e), closes #β12968
- feat: asset type add apng (#β13294) (a11b6f6), closes #β13294
- feat: emit event to handle chunk load errors (#β12084) (2eca54e), closes #β12084
- feat: import public non-asset URL (#β13422) (3a98558), closes #β13422
- feat: support files for
fs.allow(#β12863) (4a06e66), closes #β12863 - feat(build): warn dynamic import module with a static import alongside (#β12850) (127c334), closes #β12850
- feat(client): add debounce on page reload (#β13545) (d080b51), closes #β13545
- feat(client): add WebSocket connections events (#β13334) (eb75103), closes #β13334
- feat(config): friendly ESM file require error (#β13283) (b9a6ba0), closes #β13283
- feat(css): add support for Lightning CSS (#β12807) (c6c5d49), closes #β12807
- feat(css): support at import preprocessed styles (#β8400) (2bd6077), closes #β8400
- feat(html): support image set in inline style (#β13473) (2c0faba), closes #β13473
- feat(importMetaGlob): support sub imports pattern (#β12467) (e355c9c), closes #β12467
- feat(optimizer): support glob includes (#β12414) (7792515), closes #β12414
- feat!: update esbuild to 0.18.2 (#β13525) (ab967c0), closes #β13525
Bug Fixes
- fix: check document before detect script rel (#β13559) (be4b0c0), closes #β13559
- fix(define): stringify object parse error in build mode (#β13600) (71516db), closes #β13600
- fix(deps): update all non-major dependencies (#β13701) (02c6bc3), closes #β13701
- fix(esbuild): use
useDefineForClassFields: falsewhen nocompilerOptions.targetis declared (#β13 (7ef2472), closes #β13708 - fix(pluginContainer): drop previous sourcesContent (#β13722) (9310b3a), closes #β13722
- fix: lightningCSS should load external URL in CSS file (#β13692) (8517645), closes #β13692
- fix: shortcut open browser when set host (#β13677) (6f1c55e), closes #β13677
- fix(cli): convert the sourcemap option to boolean (fix #β13638) (#β13663) (d444bfe), closes #β13638 #β13663
- fix(css): use esbuild legalComments config when minifying CSS (#β13661) (2d9008e), closes #β13661
- fix(sourcemap): preserve original sourcesContent (#β13662) (f6362b6), closes #β13662
- fix(ssr): transform superclass identifier (#β13635) (c5b2c8f), closes #β13635
- fix: show error position (#β13623) (90271a6), closes #β13623
- fix(hmr): only invalidate
lastHMRTimestampof importers if the invalidated module is not a HMR bou (1143e0b), closes #β13024 - fix(indexHtml): decode html URI (#β13581) (f8868af), closes #β13581
- fix: avoid binding ClassExpression (#β13572) (1a0c806), closes #β13572
- fix: the shortcut fails to open browser when set the host (#β13579) (e0a48c5), closes #β13579
- fix(proxy): forward SSE close event (#β13578) (4afbccb), closes #β13578
- fix: allow using vite as a proxy for another vite server (#β13218) (711dd80), closes #β13218
- fix: await requests to before server restart (#β13262) (0464398), closes #β13262
- fix: esm detection with
export const { A, B }pattern (#β13483) (ea1bcc9), closes #β13483 - fix: keep track of ssr version of imported modules separately (#β11973) (8fe6952), closes #β11973
- fix: make optimize error available to meta-framework (#β13495) (b70e783), closes #β13495
- fix: only show the listened IP when host is specified (#β13412) (20b0cae), closes #β13412
- fix: race condition creation module in graph in transformRequest (#β13085) (43cbbcf), closes #β13085
- fix: remove deprecated config.server.base (#β13482) (dc597bd), closes #β13482
- fix: remove extra path shorten when resolving from a dir (#β13381) (5503198), closes #β13381
- fix: show network URLs when
--host 0.0.0.0(#β13438) (00ee8c1), closes #β13438 - fix: timestamp config dynamicImport (#β13502) (6a87c65), closes #β13502
- fix: unexpected config temporary file (#β13269) (ff3ce31), closes #β13269
- fix: use consistent virtual module ID in module graph (#β13073) (aa1776f), closes #β13073
- fix(build): make output warning message clearer (#β12924) (54ab3c8), closes #β12924
- fix(debug): import performance from perf_hooks (#β13464) (d458ccd), closes #β13464
- fix(deps): update all non-major dependencies (#β13059) (123ef4c), closes #β13059
- fix(deps): update all non-major dependencies (#β13488) (bd09248), closes #β13488
- fix(deps): update sirv to 2.0.3 (#β13057) (d814d6c), closes #β13057
- fix(mergeConfig): don't accept callback config (#β13135) (998512b), closes #β13135
- fix(optimizer): include exports for css modules (#β13519) (1fd9919), closes #β13519
- fix(resolve): always use
modulecondition (#β13370) (367920b), closes #β13370 - fix(ssr): fix crash when a pnpm/Yarn workspace depends on a CJS package (#β9763) (9e1086b), closes #β9763
Previous Changelogs
4.4.0-beta.4 (2023-07-03)
4.4.0-beta.3 (2023-06-25)
4.4.0-beta.2 (2023-06-22)
4.4.0-beta.1 (2023-06-21)
4.4.0-beta.0 (2023-06-20)
v4.3.9
- fix: fs.deny with leading double slash (#β13348) (813ddd6), closes #β13348
- fix: optimizeDeps during build and external ids (#β13274) (e3db771), closes #β13274
- fix(css): return deps if have no postcss plugins (#β13344) (28923fb), closes #β13344
- fix(legacy): style insert order (#β13266) (e444375), closes #β13266
- chore: revert prev release commit (2a30a07)
- release: v4.3.9 (5c9abf7)
- docs: optimizeDeps.needsInterop (#β13323) (b34e79c), closes #β13323
- test: respect commonjs options in playgrounds (#β13273) (19e8c68), closes #β13273
- refactor: simplify SSR options' if statement (#β13254) (8013a66), closes #β13254
- perf(ssr): calculate stacktrace offset lazily (#β13256) (906c4c1), closes #β13256
v4.3.8
- fix: avoid outdated module to crash in importAnalysis after restart (#β13231) (3609e79), closes #β13231
- fix(ssr): skip updateCjsSsrExternals if legacy flag disabled (#β13230) (13fc345), closes #β13230
v4.3.7
- fix: revert only watch .env files in envDir (#β12587) (#β13217) (0fd4616), closes #β12587 #β13217
- fix(assetImportMetaUrl): allow ternary operator in template literal urls (#β13121) (d5d9a31), closes #β13121
v4.3.6
- fix: avoid dev-server crash when ws proxy error (#β12829) (87e1f58), closes #β12829
- fix: call
tryFsResolvefor relativenew URL(foo, import.meta.url)(#β13142) (eeb0617), closes #β13142 - fix: don't inject CSS sourcemap for direct requests (#β13115) (7d80a47), closes #β13115
- fix: handle more yarn pnp load errors (#β13160) (adf61d9), closes #β13160
- fix(build): declare moduleSideEffects for vite:modulepreload-polyfill (#β13099) (d63129b), closes #β13099
- fix(css): respect
esbuild.charsetwhen minify (#β13190) (4fd35ed), closes #β13190 - fix(server): intercept ping requests (#β13117) (d06cc42), closes #β13117
- fix(ssr): stacktrace uses abs path with or without sourcemap (#β12902) (88c855e), closes #β12902
- perf: skip windows absolute paths for node resolve (#β13162) (e640939), closes #β13162
- chore: remove useless dep (#β13165) (9a7ec98), closes #β13165
- chore(reporter): reuse clearLine (#β13156) (535795a), closes #β13156
Configuration
π Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.