-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(deps): update dependency vite to v5.4.6 [security] #6624
Conversation
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. Your PR title is: Details: Unknown scope "deps" found in pull request title "chore(deps): update dependency vite to v5.4.6 [security]". Scope must match one of: root, api, dashboard, inbound-mail, web, webhook, widget, worker, ws, ee-auth, ee-billing, ee-dal, ee-shared-services, ee-translation, application-generic, automation, dal, design-system, embed, notifications, novui, testing, client, framework, headless, js, nest, nextjs, node, notification-center, novu, providers, react, react-native, shared, stateless, nestjs, nextjs. |
67b205c
to
a919f4d
Compare
✅ Deploy Preview for novu-stg-vite-dashboard-poc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
a919f4d
to
2372df7
Compare
2372df7
to
f6a5c29
Compare
f6a5c29
to
6cbdb90
Compare
6cbdb90
to
77c418f
Compare
1dd0a35
to
b065504
Compare
b065504
to
c86ecd4
Compare
16e987c
to
5ad5e30
Compare
5ad5e30
to
62a096c
Compare
62a096c
to
576a300
Compare
576a300
to
9b135b2
Compare
This PR contains the following updates:
^4.5.2
->^5.0.0
5.4.2
->5.4.6
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
GitHub Vulnerability Alerts
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
orserver.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
.matchBase: true
, you can get any file under.git/
(config, HEAD, etc).matchBase: false
, you cannot get any file under.git/
(config, HEAD, etc).CVE-2024-45811
Summary
The contents of arbitrary files can be returned to the browser.
Details
@fs
denies access to files outside of Vite serving allow list. Adding?import&raw
to the URL bypasses this limitation and returns the file content if it exists.PoC
CVE-2024-45812
Summary
We discovered a DOM Clobbering vulnerability in Vite when building scripts to
cjs
/iife
/umd
output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.Note that, we have identified similar security issues in Webpack: GHSA-4vvj-4cpr-p986
Details
Backgrounds
DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:
[1] https://scnps.co/papers/sp23_domclob.pdf
[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/
Gadgets found in Vite
We have identified a DOM Clobbering vulnerability in Vite bundled scripts, particularly when the scripts dynamically import other scripts from the assets folder and the developer sets the build output format to
cjs
,iife
, orumd
. In such cases, Vite replaces relative paths starting with__VITE_ASSET__
using the URL retrieved fromdocument.currentScript
.However, this implementation is vulnerable to a DOM Clobbering attack. The
document.currentScript
lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server.PoC
Considering a website that contains the following
main.js
script, the devloper decides to use the Vite to bundle up the program with the following configuration.After running the build command, the developer will get following bundle as the output.
Adding the Vite bundled script,
dist/index-DDmIg9VD.js
, as part of the web page source code, the page could load theextra.js
file from the attacker's domain,attacker.controlled.server
. The attacker only needs to insert animg
tag with thename
attribute set tocurrentScript
. This can be done through a website's feature that allows users to embed certain script-less HTML (e.g., markdown renderers, web email clients, forums) or via an HTML injection vulnerability in third-party JavaScript loaded on the page.Impact
This vulnerability can result in cross-site scripting (XSS) attacks on websites that include Vite-bundled files (configured with an output format of
cjs
,iife
, orumd
) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes.Patch
Release Notes
vitejs/vite (vite)
v5.4.6
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.5
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.4
Compare Source
Please refer to CHANGELOG.md for details.
v5.4.3
Compare Source
file://
reference (#17909) (561b940), closes #17909v5.4.2
Compare Source
renderBuiltUrl
passed to module preload (#16084) (fac3a8e), closes #16084v5.4.1
Compare Source
build.modulePreload.resolveDependencies
is optimizable (#16083) (e961b31), closes #16083__vite_import_meta_env__
(#17876) (e686d74), closes #17876handleHotUpdate
from watch-package-data plugin (#17865) (e16bf1f), closes #17865v5.4.0
Compare Source
global
variable name conflict (#17809) (6aa2206), closes #17809importScripts
injection breaking iife code (#17827) (bb4ba9f), closes #17827v5.3.6
Compare Source
Please refer to CHANGELOG.md for details.
v5.3.5
Compare Source
server
type less restrictive (fix #17627) (#17628) (b55c32f), closes #17627 #17628v5.3.4
Compare Source
.css?url
in assets field of manifest (#17623) (1465b20), closes #17623v5.3.3
Compare Source
v5.3.2
Compare Source
location
(#17528) (a8e2f6f), closes #17528v5.3.1
Compare Source
v5.3.0
Compare Source
v5.2.14
Compare Source
Please refer to CHANGELOG.md for details.
v5.2.13
Compare Source
Please refer to CHANGELOG.md for details.
v5.2.12
Compare Source
build.rollupOptions.output.manualChunks
instead ofbuild.rollupOutput.manualChunks
(89378c0), closes #16721v5.2.11
Compare Source
v5.2.10
Compare Source
v5.2.9
Compare Source
fsp.rm
removing files does not take effect (#16032) (b05c405), closes #16032v5.2.8
Compare Source
/@​vite/client
when not defined (#16318) (646319c), closes #16318define
value (#15805) (445c4f2), closes #15805v5.2.7
Compare Source
__vite__mapDeps
when it's not used (#16271) (890538a), closes #16271v5.2.6
Compare Source
fs.deny
with globs with directories (#16250) (ba5269c), closes #16250v5.2.5
Compare Source
v5.2.4
Compare Source
v5.2.3
Compare Source
optimizeDeps.include
glob syntax for./*
exports (#16230) (f184c80), closes #16230prepareStackTrace
(#16220) (dad7f4f), closes #16220utf8
replaced withutf-8
(#16232) (9800c73), closes #16232v5.2.2
Compare Source
v5.2.1
Compare Source
v5.2.0
Compare Source
,
inside query parameter of image URI in srcset property (#16081) (50caf67), closes #16081@shikiji/vitepress-twoslash
(#16168) (6f8a320), closes #16168v5.1.8
Compare Source
Please refer to CHANGELOG.md for details.
v5.1.7
Compare Source
Please refer to CHANGELOG.md
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 is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.