Repository navigation
Patch frontend dependency security advisories - #154
Merged
Merged
Conversation
Bump Next.js 15.5, Nuxt 4.6, Astro 6.4, SvelteKit 2.70, Vite and sharp 0.35, regenerate lockfiles, and replace stale pnpm overrides with a minimal scoped set. Move the Nuxt frontends to pnpm 10.28 so allowBuilds is honored, retarget the nitropack patch to 2.13.6, and build the cms-i18n frontends in CI.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Without the override the lockfile resolves 2.3.0, 3.1.0 and 3.1.7, and the Nitro server bundle traces an @iconify/utils import to a path outside the project, so every SSR page returns 500.
@nuxt/icon 1.x was the only package still on @iconify/utils 2.x. With it on 2.x every package resolves a single @iconify/utils 3.1.7, so the direct dependency and override in cms/nuxt aren't needed.
CI installs with pnpm latest (12.x), which rejects lockfile entries published in the last 24 hours. The lockfiles were resolved locally with pnpm 10, which doesn't apply that policy, so CI failed on brand-new brace-expansion, caniuse-lite and rolldown releases. Set minimumReleaseAge: 1440 in every frontend's pnpm-workspace.yaml so local resolution matches CI, and re-resolve the lockfiles. Pin vite to 8.3.7 in cms/sveltekit since 8.3.8 is under a day old (8.1.6 is the patched floor).
* Fix Nuxt 4.6 build warnings, pnpm floors and CI pnpm pin * Pin CI pnpm to 12.18.0 to keep the lockfile release-age check
…lteKit advisory (#155) * Render Next.js pages on the server and return 404 for missing pages ThemeProvider returned null until it mounted, so server HTML had no page content and notFound() never reached the response, leaving missing pages at 200. It's now a plain next-themes wrapper, which already handles SSR and stores the theme under the same key. Rendering the layout on the server surfaced useVisualEditing calling useSearchParams() without a Suspense boundary. The hook only reads the query string inside an effect, so it reads window.location instead. Missing blog posts rendered a 404 message with a 200 status; they now call notFound(). * Return 404 instead of 500 for unknown SvelteKit pages fetchPageData threw for a missing page and the catch wrapped it in a generic error, so the catch-all route rethrew a plain Error and SvelteKit answered 500. fetchPageData now returns null for no match, and the route calls error(404) outside its try/catch. Real fetch failures still 500. * Answer missing Astro blog posts with a 404 instead of a redirect Redirecting to /404 answered 302. An empty 404 Response makes Astro render 404.astro at the requested URL. Astro.rewrite('/404') isn't allowed here because 404.astro is prerendered and the blog route isn't. * Serve robots.txt from every CMS frontend and add a SvelteKit sitemap Only Nuxt served robots.txt (via @nuxtjs/seo). Next.js, Astro and SvelteKit now return the same rules: allow all crawlers and point at /sitemap.xml. SvelteKit was the only frontend without a sitemap; it now lists published pages and posts like the Next.js and Astro sitemaps. * Let cms-i18n Next.js API routes reach their handlers The locale middleware treats any 2-3 letter first path segment as a locale, so "/api" became a locale and every /api request was rewritten to a page route. Form submissions failed and search never returned results. Skip /api in the middleware like the Nuxt app does, and have the search modal send x-locale so its links stay localized. * Only treat Directus languages as locale prefixes in cms-i18n Both i18n frontends treated any 2-3 letter first path segment as a locale, so a page with a short slug like /faq rendered the home page under a "faq" locale, unknown short paths returned 200 instead of 404, and the language switcher dropped the page when switching languages. getLocaleFromPath and removeLocaleFromPath now take the locale map built from the Directus languages collection and only strip codes in it. - Next.js: the middleware loads the map (public languages, cached for a minute) and the layout shares it with client components through a LocaleMapProvider. - Nuxt: the server middleware loads the map (cached) and puts it on the request context, and useLocaleMap carries it to the client for the route middleware, useLocale and the language switcher. * Set <html lang> for the current locale in cms-i18n Nuxt @nuxtjs/seo sets <html lang>, og:locale and the canonical URL from its site config, which always fell back to "en" and overrode the layout's lang. The locale middleware now sets the site config's currentLocale per request, so /es renders lang="es-ES" and /ar lang="ar-SA". * Reject // paths in the SvelteKit starter Mitigates GHSA-pfhg-q3qv-9q6r (open redirect through use:enhance on paths starting with "//", which the catch-all route accepts). It's only fixed in SvelteKit 3, so this can go once the starter upgrades. * Fix Astro blank 404, Nuxt locale map cache, and Next 404/theme issues (#158) --------- Co-authored-by: Bryant Gillespie <bryant@directus.io>
bryantgillespie
approved these changes
Nov 11, 2026
* Upgrade the CMS frontends to Zod 4 Clears GHSA-mrhx-c7xc-m3w5 (memory exhaustion validating oversized constrained collections), only fixed in zod 4.6.6+. - Next.js: @hookform/resolvers 5.9.2, whose zodResolver supports Zod 4. Refine callbacks get type guards since Zod 4 infers unknown, not any. - Nuxt: @vee-validate/zod imports Zod 3 internals and only supports Zod 3, so forms use a small local toTypedSchema adapter. @directus/types moves to 18.1.0 (what Directus 12.6.1 uses), which also drops its pinned zod 4.1.12. - SvelteKit: Superforms' zod4Client adapter. This also clears the "Type instantiation is excessively deep" error in DynamicForm.svelte. - All builders use .optional() for optional fields instead of .or(z.undefined()). Zod 4 rejects a missing key for the latter, so server-side validation refused submissions that left optional fields out. Astro was already on Zod 4 and had the same problem. * Upgrade the Astro frontend to Astro 7 Clears the remaining Astro advisories, including GHSA-26w7-cxv4-gfx2 (RCE through AVIF image optimization), only fixed in 7.x. - astro 7.4.9, @astrojs/vercel 11.0.20, vite 8.3.7 - @astrojs/react 7.1.5: 7.1.6 imports @astrojs/internal-helpers/renderer, which the 0.13.1 it pins doesn't export. Fixed in 7.1.7, which is still inside the 24h minimum release age. - Route caching is stable: experimental.cache moves to top-level cache, and experimental.queuedRendering is now the default. * Skip malformed length rules and fix optional Nuxt file fields (#159) --------- Co-authored-by: Bryant Gillespie <bryant@directus.io>
This branch had an error being deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Scope
minimumReleaseAge: 1440to every frontend'spnpm-workspace.yaml. CI installs with pnpmlatest(12.x), which rejects lockfile entries published in the last 24h, and my first pass resolved locally with pnpm 10, which doesn't enforce it. Now local resolution follows the same supply-chain policy as CIsharp@<0.35.5,postcss@<8.5.23,postcss-selector-parser@<6.1.5,cookie@<0.7.0). The oldcms/nuxtlist had ~20 pins, and two of them (unhead: 2.1.12,h3: ^1.15.9) broke Nuxt 4.6, which now needs unhead v3 and h3 v2. npmoverridesinpackage.jsonare mirrored to match. The Next apps also keeppackage.json#pnpm.overrides(andcms-i18n/nextjs's workspace file has apackagesfield) because Vercel'scms-nextjsproject installs with pnpm 9, which only reads overrides from therecms/nuxt: retarget the nitropack patch from 2.13.1 to 2.13.6 (Nuxt 4.6 needs^2.13.6, and the fix still isn't upstream). BumppackageManagerfrom pnpm 10.15.1 to 10.28.2, because 10.15 ignoresallowBuilds, so sharp/esbuild install scripts were being skipped@nuxt/icon1.11 → 2.6.2 in both Nuxt apps and dropcms/nuxt's direct@iconify/utilsdependency and override (added in Fix issue with visual editing demo #112).@nuxt/icon1.x was the last package on@iconify/utils2.x, and the mix of copies made Nitro's server bundle import one from a path outside the project, so every SSR page 500ed. Now everything resolves to a single 3.1.7. The only breaking change in@nuxt/icon2 is requiring Nuxt 4cms-i18n/nuxt: move from pnpm 8.6.0 (lockfile v6) to 10.28.2 and add apnpm-workspace.yaml. Align its Nuxt modules withcms/nuxt(@nuxtjs/seo3 → 5, sitemap, fonts, tailwindcss, unhead 3) to get rid of the old unhead v2 / nuxt-og-image chaincms-i18n/nextjsandcms-i18n/nuxtto the CI build matrix. They landed two days after the matrix was added in Add CI validation, release automation, and DX tooling #99 and never got wired in, even though they carried ~350 of the alertsnext-env.d.tspicks up theroutes.d.tsreference that Next 15.5 writes on every build, so it doesn't show up as a local change for everyonePotential Risks / Drawbacks
cms-i18n/nuxtjumps two majors on@nuxtjs/seo(3 → 5). It builds and type checks the same as before, but SEO/OG output is worth a quick lookcms-i18n/nuxtwith corepack will now get pnpm 10 instead of 8Tested Scenarios
install --frozen-lockfilefor all six apps (passes the release-age and build-script checks). Both Next apps also install frozen on pnpm 9 and 10cmsandcms-i18n), withmainrunning side by side for comparison. Next/Nuxt ran as production builds, Astro/SvelteKit as dev servers/,/blog, a post,/about-us,/contact,/privacy-policy,sitemap.xml,robots.txt, a 404, plus/es,/de,/frfor i18n): every status code matchesmain. A few routes fail the same way on both, which is pre-existing and not dependency related (SvelteKit 500s on sitemap/robots/404, and Next returns 200 for missing pages, which I'm fixing in a separate PR). Blog post pages initially failed too, but that was my local DB predating the 2.0.0authorsmigration. After migrating, posts render with authors in all six appsmainfor Next, Nuxt and SvelteKit, and for both i18n apps inen,esandar(RTL). Astro only differs by its dev toolbarpnpm install --frozen-lockfile+pnpm buildfor all six frontends, using.env.examplelike CI (Directus fetches fail as expected without a running instance, but builds complete)pnpm auditper app: down from ~880 alerts total to 4–7 per app, all of which are major-only fixes or have no upstream fixmain: Nuxt errors are unchanged (all pre-existing). SvelteKitsvelte-checkwent from 66 errors to 55, with one new one ("Type instantiation is excessively deep" inDynamicForm.svelte:47). I ruled out the superforms and Svelte versions and the arktype, effect and valibot bumps, but haven't pinned down the cause. Type-only, and CI doesn't runsvelte-checkReview Notes
Vercel – starters-nuxt-new(a personal-account project) fails on this PR while the three team projects that buildcms/nuxtpass. I can't see its logs or settings, so someone with access should take a look. It isn't a required check.What's left is intentionally out of scope. I'd like to handle these as their own PRs since they need actual code changes:
glob 14, minimatch 11 and esbuild 0.28 are build-time only and come in through other packages, so I'd rather let those clear on a future lockfile refresh than force majors through overrides. deepmerge has no upstream fix, so I'll dismiss those alerts.
The diff is ~27k lines, but nearly all of it is lockfiles. The interesting bits are the
package.jsonandpnpm-workspace.yamlfiles and the workflow change.Estimated review time: ~20m
🤖 Generated with Claude Code