fix(deps): update dependency nuxt to v3.12.4 [security] #31
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:
3.7.4
->3.12.4
GitHub Vulnerability Alerts
CVE-2024-34344
Summary
Due to the insufficient validation of the
path
parameter in the NuxtTestComponentWrapper, an attacker can execute arbitrary JavaScript on the server side, which allows them to execute arbitrary commands.Details
While running the test, a special component named
NuxtTestComponentWrapper
is available.https://github.com/nuxt/nuxt/blob/4779f5906fa4d3c784c2e2d6fe5a5c5f181faaec/packages/nuxt/src/app/components/nuxt-root.vue#L42-L43
This component loads the specified path as a component and renders it.
https://github.com/nuxt/nuxt/blob/4779f5906fa4d3c784c2e2d6fe5a5c5f181faaec/packages/nuxt/src/app/components/test-component-wrapper.ts#L9-L27
There is a validation for the
path
parameter to check whether the path traversal is performed, but this check is not sufficient.https://github.com/nuxt/nuxt/blob/4779f5906fa4d3c784c2e2d6fe5a5c5f181faaec/packages/nuxt/src/app/components/test-component-wrapper.ts#L15-L19
Since
import(...)
usesquery.path
instead of the normalizedpath
, a non-normalized URL can reach theimport(...)
function.For example, passing something like
./components/test
normalizespath
to/root/directory/components/test
, butimport(...)
still receives./components/test
.By using this behavior, it's possible to load arbitrary JavaScript by using the path like the following:
Since
resolve(...)
resolves the filesystem path, not the URI, the above URI is treated as a relative path, butimport(...)
sees it as an absolute URI, and loads it as a JavaScript.PoC
whoami
is written to/tmp/test
Demonstration video: https://www.youtube.com/watch?v=FI6mN8WbcE4
Impact
Users who open a malicious web page in the browser while running the test locally are affected by this vulnerability, which results in the remote code execution from the malicious web page.
Since web pages can send requests to arbitrary addresses, a malicious web page can repeatedly try to exploit this vulnerability, which then triggers the exploit when the test server starts.
CVE-2024-34343
Summary
The
navigateTo
function attempts to blockthejavascript:
protocol, but does not correctly use API's provided byunjs/ufo
. This library also contains parsing discrepancies.Details
The function first tests to see if the specified URL has a protocol. This uses the unjs/ufo package for URL parsing. This function works effectively, and returns true for a
javascript:
protocol.After this, the URL is parsed using the
parseURL
function. This function will refuse to parse poorly formatted URLs. Parsingjavascript:alert(1)
returns null/"" for all values.Next, the protocol of the URL is then checked using the
isScriptProtocol
function. This function simply checks the input against a list of protocols, and does not perform any parsing.The combination of refusing to parse poorly formatted URLs, and not performing additional parsing means that script checks fail as no protocol can be found. Even if a protocol was identified, whitespace is not stripped in the
parseURL
implementation, bypassing theisScriptProtocol
checks.Certain special protocols are identified at the top of
parseURL
. Inserting a newline or tab into this sequence will block the special protocol check, and bypass the latter checks.PoC
POC - https://stackblitz.com/edit/nuxt-xss-navigateto?file=app.vue
Attempt payload X, then attempt payload Y.
Impact
XSS, access to cookies, make requests on user's behalf.
Recommendations
As always with these bugs, the
URL
constructor provided by the browser is always the safest method of parsing a URL.Given the cross-platform requirements of nuxt/ufo a more appropriate solution is to make parsing consistent between functions, and to adapt parsing to be more consistent with the WHATWG URL specification.
Note
I've reported this vulnerability here as it is unclear if this is a bug in ufo or a misuse of the ufo library.
This ONLY has impact after SSR has occured, the
javascript:
protocol within a location header does not trigger XSS.Release Notes
nuxt/nuxt (nuxt)
v3.12.4
Compare Source
👉 Changelog
compare changes
🔥 Performance
resolveId
in layers (#27971)🩹 Fixes
noScripts
(#27972)/
as fallback if page can't be identified (e6109b226)html-validate
(#28024)unhead
key for ad-hoc module options (#28088)getNuxtVersion
returnsstring
(#28125)scroll-padding-top
in scrollBehavior (#28083)useAsyncData
returns undefined (#28154)getCachedData
null response (d10cea11b)app/
assrcDir
if it doesn't exist (#28176)serverDir
within layers using v4 compat (#28177)getCachedData
to return undefined (#28187)addEventListener
to register cookie store listener (#28193)set-cookie
headers (#28211)💅 Refactors
postcss
module loading (#27946)_registeredComponents
from ssrContext (#27819)errx
to handle dev log traces (#28027)📖 Documentation
nuxtApp.runWithContext
(#28000)pending
variable from data fetching docs (#28011)layers/
directory (#28128)✅ Tests
typeCheck
test in minimal build (#28166)🤖 CI
❤️ Contributors
v3.12.3
Compare Source
👉 Changelog
compare changes
🔥 Performance
fs-extra
(#27787)chokidar
when a customsrcDir
is provided (#27871)prefetchComponents
is treeshaken on server (#27905)🩹 Fixes
dir.app
(0c73cb734)navigateTo
called withopen
(#27742)refresh
type in server component refs (#27778)#vue-router
alias for backwards compat (#27896)nuxt
types (#27900)?raw
from head when in dev mode (#27940)💅 Refactors
performance.now
to measure time (d14f7ec46)📖 Documentation
refreshCookie
onuseCookie
doc page (#27744)main
branch (e7fbc9f81)useFetch
/AsyncData
in wrappers (#27785)vue-router
docs (#27895)compatibilityVersion
is available in the latest release (#27919)Nuxt 3
->Nuxt
orNuxt 3+
(3c16c890c)ref
s (#27933)🏡 Chore
4x
tag for v4 nightly releases (9d5dd5494)dev-bundler
(e3448fa0d)2.x
branch (8003cf72f)✅ Tests
🤖 CI
main
branch (7abd982f8)@vitejs/plugin-vue
again (56660cbdd)❤️ Contributors
v3.12.2
Compare Source
✅ Upgrading
As usual, our recommendation for upgrading is to run:
This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🔥 Performance
🩹 Fixes
onNuxtReady
callback without arguments (#27428)app/
dir backwards compatibility (#27529)ssr: false
(#27542)runtimeConfig
key (9e56b60c6)#app/defaults
rather than augmenting (#27567)useRouteAnnouncer
(#27562)_installedModules
(e4bfea642)app.rootId
withapp.rootAttrs.id
(#27630)mergeProps
import in islands transform (#27622)vite.cacheDir
if defined (#27628)close
is called (#27637)/
even if pages module isn't enabled (dabcb5ecc)📖 Documentation
head
(#27575)clear()
function added in 3.11 (#27615)🏡 Chore
webpack-virtual-modules
(58dd7f3a6)✅ Tests
🤖 CI
❤️ Contributors
v3.12.1
Compare Source
👉 Changelog
compare changes
🩹 Fixes
@nuxt/scripts
(0252000d7)💅 Refactors
CompatibilityDateSpec
(#27521)📖 Documentation
🏡 Chore
nuxi
dependency (#27526)✅ Tests
❤️ Contributors
v3.12.0
Compare Source
👀 Highlights
We're on the road to the release of Nuxt 4, but we've not held back in Nuxt v3.12. A huge thank you to the 75+ Nuxt contributors and community members who have been part of this release. ❤️
🚀 Testing Nuxt 4 changes
Nuxt 4 is on the horizon, and it's now possible to test out the behaviour changes that will be coming in the next major release (#26925) by setting an option in your
nuxt.config
file:As we've been merging PRs for Nuxt 4, we've been enabling them behind this flag. As much as possible we're aiming for backwards compatibility - our test matrix is running the same fixtures in both v3 and v4 compatibility mode.
There is a lot to say here, with 10+ different PRs and behaviour changes documented and testable, but for full details, including migration steps, see the v4 upgrade documentation.
We'd be very grateful for early testing of what's coming in Nuxt 4! 🙏
📜 Nuxt Scripts auto-install
We've been gradually working to release Nuxt Scripts. It's currently in public preview, but we're near a public release, so we've added some stubs for composables that (when used) will prompt installing the
@nuxt/scripts
module.👉 Watch out for the launch - and an article explaining more!
🌈 Layer auto-registration and bugfixes
Just like
~/modules
, any layers within your project in the~/layers
directory will now be automatically registered as layers in your project (#27221).We also now correctly load layer dependencies, which should resolve a range of issues with monorepos and git installations (#27338).
🌐 Built-in accessibility improvements
We now have a built-in
<NuxtRouteAnnouncer>
component and correspondinguseRouteAnnouncer
composable, which will be added by default to new Nuxt templates going forward.For full details, see the original PR (#25741) and documentation.
We're continuing to work on
nuxt/a11y
- expect to hear more on that in future!🔥 Performance improvements
We've landed some performance improvements as well, many of which are behind the
compatibilityVersion: 4
flag, such as a move away from deeply reactive asyncData payloads.Significant improvements include deduplicating modules (#27475) - which will apply mostly to layer users who specify modules in their layers. In one project, we saw 30s+ improvement in starting Nuxt.
We've also improved Vite dev server start up time by excluding common ESM dependencies from pre-bundling, and would suggest module authors consider doing the same (#27372).
We improved chunk determinism, so sequential builds should be less likely to have completely different chunk hashes (#27258).
And we tree shake more client-only composables from your server builds (#27044), and have reduced the size of server component payloads (#26863).
👨👩👧👦 Multi-app support
We've landed a couple of changes that take us toward a place of supporting multi-app natively in Nuxt, including a
multiApp
experimental flag (#27291) and the ability to have multiple Nuxt app instances running in parallel at runtime (#27068).While it's not yet ready, please do follow along on the tracker issue, and feel free to pitch in if this is interesting to you.
⛑️ DX wins
We now serialise more things in your dev server logs, including VNodes (#27309) and URLs. We also addressed a bug that could lead to a frozen dev server.
When accessing private runtime config in the browser, we now let you know with a more informative error message (#26441).
🪨 Stabilising features
We've removed some experimental options that have been stabilised and which we feel no longer need to be configurable:
experimental.treeshakeClientOnly
(enabled by default since v3.0.0)experimental.configSchema
(enabled by default since v3.3.0)experimental.polyfillVueUseHead
(disabled since v3.4.0) - implementable in user-land with pluginexperimental.respectNoSSRHeader
(disabled since v3.4.0) - implementable in user-land with server middlewareWe've also enabled
scanPageMeta
by default (#27134). This pulls out any page metadata in yourdefinePageMeta
macro, and makes it available to modules (like@nuxtjs/i18n
) so they can augment it.This unlocks much better module/typed routing integration, but has a potential performance cost - so please file an issue if you experience any problems.
💪 Type improvements
We now have support for typed
#fallback
slots in server components (#27097).We've also improved some defaults in your generated
tsconfig.json
, including settingmodule: 'preserve'
if you have a locally installed TypeScript v5.4 version (see docs) - see #26667, #27485.📦 Module author/power user improvements
We have shipped a range of type improvements for module authors, including:
installModule
(#26744)onPrehydrate
hook for hooking into the browser hydration cycle (#27037)useRuntimeConfig
andupdateRuntimeConfig
utils (#27117)🎨 Inlined UI templates
If you previously used
@nuxt/ui-templates
then it may be worth knowing that we have moved them from a separate repository into the nuxt/nuxt monorepo. (This is purely a refactor rather than a change, although you can expect some new designs for Nuxt v4.)✅ Upgrading
As usual, our recommendation for upgrading is to run:
This will refresh your lockfile as well, and ensures that you pull in updates from other dependencies that Nuxt relies on, particularly in the unjs ecosystem.
👉 Changelog
compare changes
🚀 Enhancements
useRequestURL
(#26687)imports.scan
option (#26576)<NuxtRouteAnnouncer>
anduseRouteAnnouncer
(#25741)resolvePath
andfindPath
(#26465)useLink
fromNuxtLink
(#26522)future.compatibilityVersion
(#26925)app.rootAttrs
andteleportAttrs
(#27014)cookieStore
by default (f597ca59a)onUpdated
andonUnmounted
on server (#27044)nuxt/scripts
on usage (#27010)<NuxtPage>
(#27050)renderSSRHeadOptions
config forunhead
(#26989)onPrehydrate
lifecycle hook (#27037)#fallback
slot to server components types (#27097)useRuntimeConfig
andupdateRuntimeConfig
utils (#27117)layers/
directory (#27221)appId
and improve chunk determinism (#27258)multiApp
flag (#27291)compatibilityVersion
(#27305)URL
serialiser for dev server logs (a549b46e9)this.$route
(#27313)installModule
(#26744).with
for better module options types (#26850)compatibilityDate
flag for future (#27512)🔥 Performance
asyncData
watch when unmounted (#26821)ssrContext.styles
reference (from unusedvue-style-loader
) (2d1ab61b2)shallowReactive
(#27214)🩹 Fixes
getCachedData
from shaping type ofuseAsyncData
(#25946)hasSuffix
(#26725)moduleDetection
to 'force' (#26667)nuxt._ignore
after all modules run (#26680)v-for
to slot in islands (#26880)_scope
is active before callingrun
function (#26756, #26904)enabled
isfalse
(#26906)lang="ts"
(#26912)updateAppConfig
(#26949)useState
inNuxtClientFallback
setup function (#26928).js
extension from template imports (0d4a622f3)runWithContext
(#26976)app.vue
exists inrootDir
(1af81ed0f)URL
constructor to resolve external protocols (5f0693a69)URL
for parsing URLs rather thanparseURL
(ea22d3f98)process.*
flags (#27089)NuxtTeleportIslandComponent
(#27093)spaLoadingTemplate
function (0e12b6eb8)jiti
and not file URL (#27252)buildId
in schema (#27274)location
header innavigateTo
(#27280)undefined
rather thannull
for data fetching defaults (#27294)app.cdnURL
for extracted payloads (#26668)VNode
reviver & don't deduplicate dev logs (#27309)app.config
files in nitro build (#27342)app.config.d.ts
(#27350)optimizeDeps
in ssr (#27356)hmr.server
is set (#27326)app
options (#27478)app.head
arrays (#27480)tsconfig.json
(#27485)buildAssetsDir
in island teleport dev chunk (#27469)module: preserve
unelss ts v5.4 is installed (b08dfc98b)pages:extend
hook (#27134)esnext
target (7bb02735e)boolean
value fordedupe
in v4 compat (#27511)scopeId
to server components (#27497)💅 Refactors
📖 Documentation
dependsOn
works not just for parallel plugins (#26707)--preset
flag fornuxi build
(#26759)useFetch
(#26748)callWithNuxt
(#26771)srcDir
description mentioning deprecatedstatic/
directory (#26804)pageRef
from a child page (#26806)pending
value in data fetching composables (#26766)@vue/test-utils
getting started guide (#26205)a
->an
(#26856)usePreviewMode
explanation (#26602)defineConfig
(a60de743a)@since
annotations to exported functions (#25365)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 was generated by Mend Renovate. View the repository job log.