-
Notifications
You must be signed in to change notification settings - Fork 65
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
chore(frontend): update dependency vite to v4.5.3 [security] #1280
Open
plural-renovate
wants to merge
1
commit into
master
Choose a base branch
from
renovate/frontend/npm-vite-vulnerability
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plural-renovate
bot
added
dependencies
Pull requests that update a dependency file
frontend
Changes related to the frontend
labels
Dec 6, 2023
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
2 times, most recently
from
December 18, 2023 22:23
a1fc683
to
692cfb9
Compare
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
8 times, most recently
from
January 5, 2024 23:40
d64ea47
to
154d194
Compare
plural-renovate
bot
changed the title
chore(frontend): update dependency vite to v4.4.12 [security]
chore(frontend): update dependency vite to v4.5.1 [security]
Jan 5, 2024
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
from
January 20, 2024 04:59
154d194
to
549772a
Compare
plural-renovate
bot
changed the title
chore(frontend): update dependency vite to v4.5.1 [security]
chore(frontend): update dependency vite to v4.5.2 [security]
Jan 20, 2024
⚠ Artifact update problemRenovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below: File name: www/yarn.lock
|
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
2 times, most recently
from
March 7, 2024 17:14
a74259a
to
b5a81c8
Compare
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
from
April 4, 2024 03:40
b5a81c8
to
36e38f9
Compare
plural-renovate
bot
changed the title
chore(frontend): update dependency vite to v4.5.2 [security]
chore(frontend): update dependency vite to v4.5.3 [security]
Apr 4, 2024
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
2 times, most recently
from
May 7, 2024 21:43
948d50d
to
355997a
Compare
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
from
May 10, 2024 23:05
355997a
to
9fd93bb
Compare
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
from
June 5, 2024 16:51
9fd93bb
to
1d25afd
Compare
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
4 times, most recently
from
June 24, 2024 22:11
6f521d8
to
46f1b84
Compare
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
from
July 3, 2024 15:40
46f1b84
to
3009700
Compare
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
from
July 3, 2024 16:01
3009700
to
9f9f1c3
Compare
plural-renovate
bot
force-pushed
the
renovate/frontend/npm-vite-vulnerability
branch
from
July 4, 2024 00:58
9f9f1c3
to
0d631aa
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
0 participants
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.5.0
->4.5.3
GitHub Vulnerability Alerts
CVE-2023-49293
Summary
When Vite's HTML transformation is invoked manually via
server.transformIndexHtml
, the original request URL is passed in unmodified, and thehtml
being transformed contains inline module scripts (<script type="module">...</script>
), it is possible to inject arbitrary HTML into the transformed output by supplying a malicious URL query string toserver.transformIndexHtml
.Impact
Only apps using
appType: 'custom'
and using the default Vite HTML middleware are affected. The HTML entry must also contain an inline script. The attack requires a user to click on a malicious URL while running the dev server. Restricted files aren't exposed to the attacker.Patches
Fixed in vite@5.0.5, vite@4.5.1, vite@4.4.12
Details
Suppose
index.html
contains an inline module script:This script is transformed into a proxy script like
due to Vite's HTML plugin:
https://github.com/vitejs/vite/blob/7fd7c6cebfcad34ae7021ebee28f97b1f28ef3f3/packages/vite/src/node/plugins/html.ts#L429-L465
When
appType: 'spa' | 'mpa'
, Vite serves HTML itself, andhtmlFallbackMiddleware
rewritesreq.url
to the canonical path ofindex.html
,https://github.com/vitejs/vite/blob/73ef074b80fa7252e0c46a37a2c94ba8cba46504/packages/vite/src/node/server/middlewares/htmlFallback.ts#L44-L47
so the
url
passed toserver.transformIndexHtml
is/index.html
.However, if
appType: 'custom'
, HTML is served manually, and ifserver.transformIndexHtml
is called with the unmodified request URL (as the SSR docs suggest), then the path of the transformedhtml-proxy
script varies with the request URL. For example, a request with path/
producesIt is possible to abuse this behavior by crafting a request URL to contain a malicious payload like
so a request to http://localhost:5173/?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3E produces HTML output like
which demonstrates XSS.
PoC
vite dev
middleware withappType: 'custom'
?%22%3E%3C/script%3E%3Cscript%3Ealert(%27boom%27)%3C/script%3E
and navigatevite dev
(this shows that vanillavite dev
is not vulnerable, providedhtmlFallbackMiddleware
is used)Detailed Impact
This will probably predominantly affect development-mode SSR, where
vite.transformHtml
is called using the originalreq.url
, per the docs:https://github.com/vitejs/vite/blob/7fd7c6cebfcad34ae7021ebee28f97b1f28ef3f3/docs/guide/ssr.md?plain=1#L114-L126
However, since this vulnerability affects
server.transformIndexHtml
, the scope of impact may be higher to also include other ad-hoc calls toserver.transformIndexHtml
from outside of Vite's own codebase.My best guess at bisecting which versions are vulnerable involves the following test script
and using it I was able to narrow down to #13581. If this is correct, then vulnerable Vite versions are 4.4.0-beta.2 and higher (which includes 4.4.0).
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 vite@5.0.12, vite@4.5.2, vite@3.2.8, vite@2.9.17
Details
Since
picomatch
defaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible.See
picomatch
usage, wherenocase
is defaulted tofalse
: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632By requesting raw filesystem paths using augmented casing, the matcher derived from
config.server.fs.deny
fails to block access to sensitive files.PoC
Setup
npm create vite@latest
on a Standard Azure hosted Windows 10 instance.npm run dev -- --host 0.0.0.0
custom.secret
andproduction.pem
vite.config.js
withReproduction
curl -s http://20.12.242.81:5173/@​fs//
curl -s http://20.12.242.81:5173/@​fs/C:/Users/darbonzo/Desktop/vite-project/vite.config.js
curl -s http://20.12.242.81:5173/@​fs/C:/Users/darbonzo/Desktop/vite-project/custom.sEcReT
Proof
Impact
Who
What
server.fs.deny
are both discoverable, and accessibleCVE-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
orserver.host
config option) are affected.Patches
Fixed 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
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
.matchBase: true
, you can get any file under.git/
(config, HEAD, etc).matchBase: false
, you cannot get any file under.git/
(config, HEAD, etc).Release Notes
vitejs/vite (vite)
v4.5.3
Compare Source
Please refer to CHANGELOG.md for details.
v4.5.2
Compare Source
Please refer to CHANGELOG.md for details.
v4.5.1
Compare Source
Please refer to CHANGELOG.md for details.
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.
This PR has been generated by Renovate Bot.