Skip to content

Update dependency vite@>=5.0.0 <=5.4.11 to v6 [SECURITY] #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 26, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
vite@>=5.0.0 <=5.4.11 (source) [>=5.4.12 -> >=6.1.5](https://renovatebot.com/diffs/npm/vite@&gt;&#x3D;5.0.0 <=5.4.11/5.4.12/6.1.5) age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2025-30208

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

@fs denies access to files outside of Vite serving allow list. Adding ?raw?? or ?import&raw?? to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as ? are removed in several places, but are not accounted for in query string regexes.

PoC

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

$ echo "top secret content" > /tmp/secret.txt

# expected behaviour
$ curl "http://localhost:5173/@&#8203;fs/tmp/secret.txt"

    <body>
      <h1>403 Restricted</h1>
      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.

# security bypassed
$ curl "http://localhost:5173/@&#8203;fs/tmp/secret.txt?import&raw??"
export default "top secret content\n"
//# sourceMappingURL=data:application/json;base64,eyJ2...

CVE-2025-31125

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

  • base64 encoded content of non-allowed files is exposed using ?inline&import (originally reported as ?import&?inline=1.wasm?init)
  • content of non-allowed files is exposed using ?raw?import

/@&#8203;fs/ isn't needed to reproduce the issue for files inside the project root.

PoC

Original report (check details above for simplified cases):

The ?import&?inline=1.wasm?init ending allows attackers to read arbitrary files and returns the file content if it exists. Base64 decoding needs to be performed twice

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

Example full URL http://localhost:5173/@&#8203;fs/C:/windows/win.ini?import&?inline=1.wasm?init

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/@&#8203;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 /@&#8203;fs/Users/doggy/Desktop/vite-project/#/../../../../../etc/passwd http://127.0.0.1:5173

Release Notes

vitejs/vite (vite@>=5.0.0 <=5.4.11)

v6.1.5

Compare Source

Please refer to CHANGELOG.md for details.

v6.1.4

Compare Source

Please refer to CHANGELOG.md for details.

v6.1.3

Compare Source

Please refer to CHANGELOG.md for details.

v6.1.2

Compare Source

Please refer to CHANGELOG.md for details.

v6.1.1

Compare Source

v6.1.0

Compare Source

Features
Fixes
Chore
Beta Changelogs
6.1.0-beta.2 (2025-02-04)

See 6.1.0-beta.2 changelog

6.1.0-beta.1 (2025-02-04)

See 6.1.0-beta.1 changelog

6.1.0-beta.0 (2025-01-24)

See 6.1.0-beta.0 changelog

v6.0.15

Compare Source

Please refer to CHANGELOG.md for details.

v6.0.14

Compare Source

Please refer to CHANGELOG.md for details.

v6.0.13

Compare Source

Please refer to CHANGELOG.md for details.

v6.0.12

Compare Source

Please refer to CHANGELOG.md for details.

v6.0.11

Compare Source

v6.0.10

Compare Source

v6.0.9

Compare Source

  • fix!: check host header to prevent DNS rebinding attacks and introduce server.allowedHosts (bd896fb)
  • fix!: default server.cors: false to disallow fetching from untrusted origins (b09572a)
  • fix: verify token for HMR WebSocket connection (029dcd6)

v6.0.8

Compare Source

v6.0.7

Compare Source

v6.0.6

Compare Source

v6.0.5

Compare Source

v6.0.4

Compare Source

v6.0.3

Compare Source

v6.0.2

Compare Source

v6.0.1

Compare Source

v6.0.0

Compare Source

Vite 6 is out!

Today, we're taking another big step in Vite's story. The Vite team, contributors, and ecosystem partners are excited to announce the release of the next Vite major:

We want to thank the more than 1K contributors to Vite Core and the maintainers and contributors of Vite plugins, integrations, tools, and translations that have helped us craft this new major. We invite you to get involved and help us improve Vite for the whole ecosystem. Learn more at our Contributing Guide.

Breaking Changes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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 requested a review from prisis as a code owner March 26, 2025 19:36
@renovate renovate bot enabled auto-merge (squash) March 26, 2025 19:36
Copy link
Contributor

coderabbitai bot commented Mar 26, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

github-actions bot commented Mar 26, 2025

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Update dependency vite@&gt;&#x3D;5.0.0 &lt;&#x3D;5.4.11 to v6 [SECURITY]". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - build
 - chore
 - ci
 - docs
 - feat
 - fix
 - perf
 - infra
 - refactor
 - revert
 - test

Copy link

pkg-pr-new bot commented Mar 26, 2025

Open in StackBlitz

@anolilab/multi-semantic-release

npm i https://pkg.pr.new/anolilab/semantic-release/@anolilab/multi-semantic-release@138

@anolilab/rc

npm i https://pkg.pr.new/anolilab/semantic-release/@anolilab/rc@138

@anolilab/semantic-release-pnpm

npm i https://pkg.pr.new/anolilab/semantic-release/@anolilab/semantic-release-pnpm@138

@anolilab/semantic-release-preset

npm i https://pkg.pr.new/anolilab/semantic-release/@anolilab/semantic-release-preset@138

@anolilab/semantic-release-clean-package-json

npm i https://pkg.pr.new/anolilab/semantic-release/@anolilab/semantic-release-clean-package-json@138

commit: 1322c6f

Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.56%. Comparing base (edf108c) to head (1322c6f).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #138      +/-   ##
==========================================
- Coverage   65.13%   64.56%   -0.58%     
==========================================
  Files          32       32              
  Lines         803      807       +4     
  Branches      114      136      +22     
==========================================
- Hits          523      521       -2     
- Misses        280      283       +3     
- Partials        0        3       +3     
Flag Coverage Δ
rc 92.17% <ø> (ø)
semantic-release-clean-package-json 85.05% <ø> (-0.96%) ⬇️
semantic-release-pnpm 50.20% <ø> (-0.51%) ⬇️

see 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@renovate renovate bot force-pushed the renovate/npm-vite>=5.0.0-<=5.4.11-vulnerability branch 2 times, most recently from 20caff9 to 38c4362 Compare April 1, 2025 10:56
@renovate renovate bot changed the title Update dependency vite@&gt;&#x3D;5.0.0 &lt;&#x3D;5.4.11 to v6 [SECURITY] Update dependency vite@&gt;&#x3D;5.0.0 &lt;&#x3D;5.4.11 to >=5.4.16 [SECURITY] Apr 1, 2025
@renovate renovate bot force-pushed the renovate/npm-vite>=5.0.0-<=5.4.11-vulnerability branch from 38c4362 to ae5e825 Compare April 1, 2025 17:05
@renovate renovate bot changed the title Update dependency vite@&gt;&#x3D;5.0.0 &lt;&#x3D;5.4.11 to >=5.4.16 [SECURITY] Update dependency vite@&gt;&#x3D;5.0.0 &lt;&#x3D;5.4.11 to v6 [SECURITY] Apr 1, 2025
Copy link

socket-security bot commented Apr 1, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License

View full report

@renovate renovate bot force-pushed the renovate/npm-vite>=5.0.0-<=5.4.11-vulnerability branch from ae5e825 to 318c3da Compare April 4, 2025 14:50
@renovate renovate bot force-pushed the renovate/npm-vite>=5.0.0-<=5.4.11-vulnerability branch from 318c3da to a2faf57 Compare April 11, 2025 19:43
@renovate renovate bot force-pushed the renovate/npm-vite>=5.0.0-<=5.4.11-vulnerability branch from a2faf57 to 6cec939 Compare April 24, 2025 06:35
@renovate renovate bot changed the title Update dependency vite@&gt;&#x3D;5.0.0 &lt;&#x3D;5.4.11 to v6 [SECURITY] Update dependency vite@&gt;&#x3D;5.0.0 &lt;&#x3D;5.4.11 to >=5.4.18 [SECURITY] Apr 24, 2025
BREAKING CHANGE: updated dependencies to major versions
@renovate renovate bot force-pushed the renovate/npm-vite>=5.0.0-<=5.4.11-vulnerability branch from 6cec939 to 1322c6f Compare April 24, 2025 15:44
@renovate renovate bot changed the title Update dependency vite@&gt;&#x3D;5.0.0 &lt;&#x3D;5.4.11 to >=5.4.18 [SECURITY] Update dependency vite@&gt;&#x3D;5.0.0 &lt;&#x3D;5.4.11 to v6 [SECURITY] Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants