Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Apr 4, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
vite (source) 6.2.4 -> 6.2.6 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2025-31486

Summary

The contents of arbitrary files 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..

Details

.svg

Requests ending with .svg are loaded at this line.
https://github.com/vitejs/vite/blob/037f801075ec35bb6e52145d659f71a23813c48f/packages/vite/src/node/plugins/asset.ts#L285-L290
By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the restriction was able to bypass.

This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+.

relative paths

The check was applied before the id normalization. This allowed requests to bypass with relative paths (e.g. ../../).

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read etc/passwd

curl 'http://127.0.0.1:5173/etc/passwd?.svg?.wasm?init'
curl 'http://127.0.0.1:5173/@​fs/x/x/x/vite-project/?/../../../../../etc/passwd?import&?raw'

CVE-2025-32395

Summary

The contents of arbitrary files can be returned to the browser if the dev server is running on Node or Bun.

Impact

Only apps with the following conditions are affected.

  • explicitly exposing the Vite dev server to the network (using --host or server.host config option)
  • running the Vite dev server on runtimes that are not Deno (e.g. Node, Bun)

Details

HTTP 1.1 spec (RFC 9112) does not allow # in request-target. Although an attacker can send such a request. For those requests with an invalid request-line (it includes request-target), the spec recommends to reject them with 400 or 301. The same can be said for HTTP 2 (ref1, ref2, ref3).

On Node and Bun, those requests are not rejected internally and is passed to the user land. For those requests, the value of http.IncomingMessage.url contains #. Vite assumed req.url won't contain # when checking server.fs.deny, allowing those kinds of requests to bypass the check.

On Deno, those requests are not rejected internally and is passed to the user land as well. But for those requests, the value of http.IncomingMessage.url did not contain #.

PoC

npm create vite@latest
cd vite-project/
npm install
npm run dev

send request to read /etc/passwd

curl --request-target /@​fs/Users/doggy/Desktop/vite-project/#/../../../../../etc/passwd http://127.0.0.1:5173

Release Notes

vitejs/vite (vite)

v6.2.6

Compare Source

Please refer to CHANGELOG.md for details.

v6.2.5

Compare Source

Please refer to CHANGELOG.md for details.


Configuration

📅 Schedule: Branch creation - "" in timezone Europe/Berlin, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, 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.

@renovate renovate bot added the security label Apr 4, 2025
@renovate renovate bot requested a review from Shinigami92 as a code owner April 4, 2025 16:03
@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 94.69% (🎯 90%)
🟰 ±0%
2693 / 2844
🟢 Statements 94.69% (🎯 90%)
🟰 ±0%
2693 / 2844
🟢 Functions 96.29% (🎯 90%)
🟰 ±0%
104 / 108
🟢 Branches 92.95% (🎯 90%)
🟰 ±0%
633 / 681
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Unchanged Files
src/doctype-shortcut-registry.ts 100% 100% 100% 100%
src/index.ts 93.18% 100% 71.42% 93.18% 79-81, 84-86
src/logger.ts 77.46% 90.9% 81.81% 77.46% 37-46, 93-94, 153-157
src/printer.ts 94.25% 94.15% 100% 94.25% 334-335, 371-372, 521-523, 535-544, 549-562, 610-646, 662-663, 701-702, 769-773, 1122-1123, 1216-1217, 1244, 1256-1257, 1557-1558, 1604-1605, 1930-1936, 1974-1979
src/options/common.ts 100% 100% 100% 100%
src/options/constants.ts 100% 100% 100% 100%
src/options/converge.ts 100% 60% 100% 100%
src/options/index.ts 100% 100% 100% 100%
src/options/pug-attribute-separator.ts 89.74% 75% 100% 89.74% 52-55
src/options/pug-class-location.ts 100% 100% 100% 100%
src/options/pug-class-notation.ts 100% 100% 100% 100%
src/options/pug-closing-bracket-indent-depth.ts 100% 100% 100% 100%
src/options/pug-comment-preserve-spaces.ts 100% 100% 100% 100%
src/options/pug-explicit-div.ts 100% 100% 100% 100%
src/options/pug-framework.ts 100% 100% 100% 100%
src/options/pug-id-notation.ts 100% 100% 100% 100%
src/options/pug-preserve-attribute-brackets.ts 100% 100% 100% 100%
src/options/pug-preserve-whitespace.ts 100% 100% 100% 100%
src/options/pug-single-file-component-indentation.ts 100% 100% 100% 100%
src/options/pug-wrap-attributes.ts 100% 100% 100% 100%
src/options/types.ts 100% 100% 100% 100%
src/options/attribute-sorting/index.ts 100% 100% 100% 100%
src/options/attribute-sorting/utils.ts 95.69% 94.44% 100% 95.69% 82-83, 94-95
src/options/empty-attributes/index.ts 100% 100% 100% 100%
src/options/empty-attributes/types.ts 100% 100% 100% 100%
src/options/empty-attributes/utils.ts 100% 100% 100% 100%
src/utils/angular.ts 100% 100% 100% 100%
src/utils/common.ts 89.67% 86.11% 100% 89.67% 19-20, 27-28, 56-57, 258-259, 262-263, 269-272, 331-332
src/utils/script-mime-types.ts 87.5% 83.33% 100% 87.5% 42-43, 49-50
src/utils/svelte.ts 100% 100% 100% 100%
src/utils/vue.ts 100% 100% 100% 100%
Generated in workflow #568 for commit 8ce6672 by the Vitest Coverage Report Action

@renovate renovate bot changed the title Update dependency vite to v6.2.5 [SECURITY] Update dependency vite to v6.2.6 [SECURITY] Apr 11, 2025
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 3f7fbd3 to 5633828 Compare April 11, 2025 15:31
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch 2 times, most recently from bd6e61f to 133faa7 Compare April 28, 2025 17:47
@Shinigami92 Shinigami92 enabled auto-merge (squash) April 28, 2025 17:51
@renovate renovate bot force-pushed the renovate/npm-vite-vulnerability branch from 133faa7 to 8ce6672 Compare April 28, 2025 17:51
@Shinigami92 Shinigami92 merged commit 4cc818b into main Apr 28, 2025
10 checks passed
@Shinigami92 Shinigami92 deleted the renovate/npm-vite-vulnerability branch April 28, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants