Skip to content

chore(deps): update dependency astro to v7.4.7 [security] - #36

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-astro-vulnerability
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-astro-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Nov 15, 2026

Copy link
Copy Markdown

This PR contains the following updates:

Package Change Age Confidence
astro (source) 7.3.7 → 7.4.7 age confidence

Astro: Image endpoint in @​astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems

CVE-2026-126364 / GHSA-r3h5-4585-7x3w

More information

Details

Summary

The /_image endpoint used by the @astrojs/node adapter checks that a requested local image is inside the build output directory before reading it from disk. That check compared paths case-insensitively. On case-sensitive filesystems (such as Linux), a directory whose path differs from the output directory only by letter case is a different directory, but it passed the check.

For example, with the client output directory at /srv/app/dist/client/, a request such as:

/_image?href=/../../DIST/client/secret.png&w=32&f=png

resolved to /srv/app/DIST/client/secret.png and was served, even though that file is outside the output directory.

Impact

An unauthenticated attacker can read image files from outside the output directory, but only when all of the following are true:

  • The site uses on-demand rendering with the @astrojs/node adapter.
  • The server runs on a case-sensitive filesystem.
  • A directory exists whose path matches the output directory except for letter case (for example DIST/client next to dist/client). Such a layout is unusual, and the attacker cannot create it.

Only files the image service accepts can be read. Raster images are returned after resizing; SVG files are returned unchanged. Other file types fail during processing. Plain path traversal outside the output directory (for example /../../secret.png) was already rejected and is not affected.

Affected versions

astro >= 5.14.3, <= 7.4.6, when used with @astrojs/node (all versions up to 11.1.11). The vulnerable image endpoint is provided by astro and used by the @astrojs/node adapter.

Patches

Fixed in astro 7.4.7. The path check now compares paths exactly, and only ignores letter case for Windows drive-letter paths. The fix ships in astro, so upgrading @astrojs/node alone is not enough.

Workarounds

Upgrade to astro 7.4.7 or later. Before upgrading, make sure no directory next to the build output directory has a path that differs from it only by letter case.

Credits

Reported by @​zachariah-mithani.

Severity

  • CVSS Score: 6.3 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Astro: XSS via attribute injection in dynamic tag names

CVE-2026-126361 / GHSA-mh32-jxcr-mh9f

More information

Details

Summary

When a dynamic tag (const Tag = ...; <Tag />) resolves to a string, Astro renders it as a raw HTML element name. The name was filtered to remove characters that could inject attributes, but the filter did not handle /. Because HTML parsers treat / inside a tag as an attribute separator, a tag name such as img/src/onerror=alert(1) was rendered as an <img> element with an onerror attribute. The JSX renderer used for MDX did not filter string tag names at all.

For example:

---
const Tag = Astro.url.searchParams.get('as') ?? 'div';
---
<Tag>hello</Tag>

rendered ?as=img/src/onerror=alert(1) as live HTML.

Impact

Reflected or stored cross-site scripting, but only in applications that use untrusted input (such as a request parameter or an uncontrolled CMS field) as all or part of an element name. Astro itself never derives element names from request data.

Applications that let content choose an element should map that input to a fixed set of known tags. Letting untrusted input choose an element name is unsafe even with a correct filter, because it can still select elements such as script or iframe.

Affected versions

astro <= 7.4.4.

Patches

Fixed in astro 7.4.5. String tag names in .astro dynamic tags, JSX, and MDX now render only the leading valid element name, so characters such as / or = can no longer change the generated markup. Strings that do not start with a valid element name now throw an error.

Workarounds

Upgrade to astro 7.4.5 or later. Before upgrading, do not use untrusted input as an element name, or map it to a fixed set of known tags.

Credits

Reported by @​uttej-badwane.

Severity

  • CVSS Score: 2.3 / 10 (Low)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

withastro/astro (astro)

v7.4.7

Compare Source

Patch Changes

v7.4.6

Compare Source

Patch Changes
  • #​18565 cd09986 Thanks @​praveen-kumary! - Avoids attributing client-only components or scripts to unrelated pages importing astro:i18n by bounding top-level page graph traversal at virtual page entries

  • #​18608 babd96d Thanks @​umeraamir69! - Fixes an extra page reload on the first page load after starting astro dev without an existing .astro directory

  • #​18589 402c0fa Thanks @​astro-factory! - Fixes astro check exiting with code 0 when @astrojs/check or typescript is not installed. The command now exits with code 1 so CI fails instead of silently skipping type checking.

  • #​18503 54fcdd5 Thanks @​SwastikTripathi! - Preserves the last-modified date of cached font files and unchanged public files when copying them into the build output. Public-file timestamp preservation respects the resolved public-directory configuration, follows source symlinks, and avoids backdating files overwritten by build plugins.

  • #​18605 76cd239 Thanks @​astro-factory! - Fixes the glob() loader adding files from a folder excluded with a negation pattern such as !_docs when they change during astro dev

  • #​18432 ed60d82 Thanks @​alexmv! - Improves the MissingSharp error to include the reason Sharp failed to load, such as its prebuilt binaries not supporting the current CPU

  • #​18474 59543c3 Thanks @​miottid! - Fixes i18n fallback for on-demand rendered pages. A locale-prefixed request for a page that only exists in the fallback locale (for example /de/about with fallback: { de: 'en' }) was answered with status 302 and no Location header. Such requests are now rewritten or redirected to the fallback locale according to i18n.routing.fallbackType, including encoded paths and sites with a configured base. Query strings are preserved, and explicit page statuses and redirects are left unchanged.

  • #​18541 cfa2d2b Thanks @​ump45nose! - Fixes matchAllRoutes to consider fallbackRoutes, matching matchRoute and the production router. Dev-server i18n fallback requests now resolve to the source route's metadata instead of the 404 route, and SSR-only fallback candidates can fall through the prerender handler.

  • #​18602 d856064 Thanks @​astro-factory! - Fixes astro check losing the end of its output, including the Result summary, when stdout is piped to a slow reader. When the reader closes the pipe early, for example astro check | head, astro check now exits with code 1 instead of crashing with an EPIPE stack trace.

  • #​18574 da0f149 Thanks @​astro-factory! - Fixes an unnecessary full page reload in astro dev when a content loader calls store.clear() or store.delete() and the content store has no asset imports

  • #​18570 e71c038 Thanks @​astro-factory! - Fixes pages using <ClientRouter /> briefly showing the top of the page on reload before jumping back to the previous scroll position. Full reloads now use the browser's native scroll restoration.

  • #​18531 f75553b Thanks @​praveen-kumary! - Fixes an unhandled TypeError: Cannot convert undefined or null to object when calling route.generate() without arguments on static routes

v7.4.5

Compare Source

Patch Changes
  • #​18558 fac3c50 Thanks @​astro-factory! - Fixes astro dev status and other background server commands deleting the lock file of a running dev or preview server when run from a sandbox or as another user that is not permitted to signal its process

  • #​18559 10dae2f Thanks @​astro-factory! - Fixes import.meta.env values containing $ sequences (such as $$ or $&) being corrupted in astro build when server code reads the import.meta.env object directly, for example with const { MY_SECRET } = import.meta.env

  • #​18544 e3bec3d Thanks @​skezo! - Fixes request paths with invalid percent-encoding (e.g. /%C0%AF or a bare %) being logged as an Invalid URL encoding error and routed with the undecoded path. These requests now return a 400, the same as a path that is encoded too many times.

  • #​18520 e023aba Thanks @​matthewp! - Makes rendering of string tag names stricter and consistent across .astro dynamic tags, JSX, and MDX. Only the leading part of the string that is a valid element name is rendered, so characters such as / or = can no longer change the generated markup. A string that does not start with a valid element name (for example '!--' or '') now throws an error instead of producing invalid HTML.

v7.4.4

Compare Source

Patch Changes

v7.4.3

Compare Source

Patch Changes
  • #​18488 e4e25fa Thanks @​umeraamir69! - CSP no longer hashes empty children on external stylesheets and scripts, which was inserting the SHA-256 of the empty string into script-src and style-src.

  • #​18500 e5a3a1b Thanks @​astro-factory! - Fixes <Image> and <Picture> emitting duplicate srcset candidates when densities contains equivalent values such as 1 and '1x'

  • #​18517 c3185b7 Thanks @​okxint! - Fix unhandled AbortError rejection when ClientRouter skips a pending view transition

  • #​18497 c712113 Thanks @​astro-factory! - Fixes an uncaught TypeError in the browser when a server:defer island request fails due to a network error. The fallback content is kept, as it is for non-200 responses.

  • #​18525 d0240b9 Thanks @​astro-factory! - Fixes a DEP0190 deprecation warning printed by astro info on Node.js 24 and later

  • #​18522 776b9a6 Thanks @​astro-factory! - Fixes memoryCache() serving an empty body for cached pages that return an empty 404 or 500 response. These responses now render the 404 or 500 error page on every request.

  • #​18511 d060ff9 Thanks @​astro-factory! - Fixes transition:name styles missing in dev when the element is inside a component that is only rendered through another component with no styles or scripts

  • #​18494 5fe699c Thanks @​astro-factory! - Fixes the astro CLI refusing to run on StackBlitz by allowing Node.js >=22.22.0 inside WebContainers, whose Node.js version users cannot change

  • #​18506 bf43a60 Thanks @​astro-factory! - Fixes <ClientRouter /> animating scroll restoration on back/forward navigation when scroll-behavior: smooth is set. Saved scroll positions are now restored instantly, matching the browser's native behavior.

  • #​18476 8ea79a2 Thanks @​astro-factory! - Fixes a DataCloneError crash when building pages that render SVG imports with <Image /> or getImage() while experimental.parallelPrerender is enabled.

  • #​18504 6dbd737 Thanks @​astro-factory! - Fixes <Picture> emitting a duplicate 1x candidate in <source> srcset when densities includes 1

  • #​18524 7524889 Thanks @​astro-factory! - Fixes type errors reported in Astro's built-in <Image />, <Picture />, <Code />, <Debug /> and <ClientRouter /> components when type-checking a project that extends astro/tsconfigs/strictest with tsc and @astrojs/ts-content-mapper

  • #​18493 3773941 Thanks @​astro-factory! - Fixes scoped styles of unused Astro components being included in the build when those components are re-exported from a barrel file

  • #​18512 1151b9e Thanks @​jp-knj! - Fixes CSP hashes added with Astro.csp from components rendered inside <body> being left out of the CSP <meta> element in static builds, including MDX pages

  • Updated dependencies [6cf3423, edfbf4a]:

v7.4.2

Compare Source

Patch Changes
  • #​18430 dda9ec3 Thanks @​Abhirup-99! - Speeds up content sync with experimental.collectionStorage: "chunked" by computing each character's UTF-8 width from its code point instead of encoding every character through TextEncoder. On a store of ~44k entries this cuts the chunking step from about 60 seconds to well under a second, with byte-identical output.

  • #​18438 5e0eaa4 Thanks @​astro-factory! - Fixes astro dev with @astrojs/cloudflare failing with Calling `require` for "node-fetch" when a server dependency such as cross-fetch requires node-fetch

  • #​18376 a4e201d Thanks @​okxint! - Fixes astro dev treating a stale lock file containing a Linux thread ID as a running Astro server. A successful process lookup with no matching PID now marks the lock as stale, preventing astro dev stop and astro dev --force from killing the unrelated process that owns the thread.

  • #​18467 d1fb7d3 Thanks @​astro-factory! - Fixes the defineConfig() types for i18n.defaultLocale, i18n.fallback, and i18n.domains so they accept a custom locale's path instead of its codes, matching how Astro validates and uses these values

  • #​18475 cf27e70 Thanks @​ematipico! - Bumps the minimum supported Node.js version to 22.23.4, which includes the fixes from the October 2026 Node.js security releases

    This is a patch release because the Node.js support and upgrade policy allows the Core team to raise the minimum Maintenance LTS version in a patch release when a disclosed and fixed Node.js security flaw affects Astro.

  • #​18451 7a0ba6f Thanks @​DenisCDev! - Fixes astro sync, astro check and astro build replacing the optimized dependencies of a dev server running in the same project, which broke framework islands in that dev server until it was restarted with --force

  • #​18336 e943003 Thanks @​astro-factory! - Fixes inline styles in dev so that framework-transformed CSS is used, such as scoped styles and v-bind() in Vue single-file components

  • #​18399 829fc00 Thanks @​astro-factory! - Fixes a dev server error (Could not find server component name) for a server:defer island that imports astro:actions or astro:config/server, when its page was not the first island page loaded after starting the server

  • #​18330 4db9e0d Thanks @​Samuteg! - Fixes the astro:env/server virtual module being generated with invalid JS in dev when any environment variable contains $ replacement patterns ($`, $&, $', $1, …). The inlined env JSON was passed as a string to String.replace, so e.g. the KITTY_PUBLIC_KEY value set by default in Kitty terminals corrupted the module and broke dev with Failed to parse source for import analysis

  • Updated dependencies [cf27e70]:

v7.4.1

Compare Source

Patch Changes

v7.4.0

Compare Source

Minor Changes
  • #​17894 b7a1bd9 Thanks @​Princesseuh! - Adds a new --timings flag to astro build to help you find what slows down your builds

    When a build takes longer than expected, it can be hard to tell whether the cause is an integration, a Markdown processor plugin, image processing, or even syntax highlighting. Add the --timings flag to your build command to print a summary once the build finishes:

    astro build --timings

    This is helpful to decide what to optimize first, or to compare build times before and after a change to your project.

  • #​17830 a937b0d Thanks @​florian-lefebvre! - Adds a new optional getFontProperties() callback to font providers

    Font providers can now expose the weights, styles, subsets and formats a font family actually has. Astro uses it when resolving your font configuration to warn about values a provider cannot serve, for example a weight a font family does not offer.

    All built-in providers implement it. If you maintain a custom font provider, implementing this callback is optional for now but it will be required in Astro 8:

    import type { FontProvider } from 'astro';
    
    const provider: FontProvider = {
    	name: 'my-provider',
    	resolveFont: ({ familyName }) => {
    		// ...
    	},
    	getFontProperties: ({ familyName }) => ({
    		weights: ['400', '700'],
    		styles: ['normal', 'italic'],
    		subsets: ['latin'],
    		formats: ['woff2'],
    	}),
    };
  • #​17830 a937b0d Thanks @​florian-lefebvre! - Adds a fetch() function to the font provider init() context

    This function requests a provider API, retrying transient failures and more. It lets providers that wrap a 3rd-party unifont provider pass the context to it directly:

    import type { FontProvider } from 'astro';
    import type { InitializedProvider } from 'unifont';
    import { acmeProvider } from '@acme/unifont-provider';
    
    export function acmeFontProvider(): FontProvider {
    	const provider = acmeProvider();
    	let initializedProvider: InitializedProvider | undefined;
    	return {
    		name: provider._name,
    		async init(context) {
    			initializedProvider = await provider(context);
    		},
    		// ...
    	};
    }
  • #​18015 0b30239 Thanks @​florian-lefebvre! - Adds experimental.redirectPage, letting you provide your own src/pages/3xx.astro in place of the redirect page Astro generates in static builds.

    A static site has no server to send an HTTP Location header, so Astro generates a small HTML page with a <meta http-equiv="refresh"> tag for each redirect it builds:

    • Your redirects entries
    • Astro.redirect() calls in prerendered pages
    • i18n redirects

    That page's markup, wording, and refresh delay were fixed, so you could not brand or translate it.

    To enable this feature, add the experimental flag to your Astro config:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        redirectPage: true,
      },
    });

    Then create src/pages/3xx.astro. Astro renders it once per redirect, passing that redirect's details as props:

    ---
    // src/pages/3xx.astro
    import type { RedirectPageProps as Props } from 'astro';
    
    const { from, to, status, delay } = Astro.props;
    ---
    
    <html lang="en">
      <head>
        <meta http-equiv="refresh" content={`${delay};url=${to}`} />
        <meta name="robots" content="noindex" />
        <title>Redirecting…</title>
      </head>
      <body>
        <p>This page has moved. <a href={to}>Continue to {to}</a>.</p>
      </body>
    </html>

    Your page must render a <meta http-equiv="refresh"> tag pointing at to, because in a static build that tag is the redirect. Astro logs a warning during the build if it is missing.

    See the experimental redirect page documentation for more information.

  • #​18265 910ee69 Thanks @​astro-factory! - Adds a notFound() handler to astro/fetch and astro/hono that renders the custom 404 page when no route matches, including a prerendered 404.astro

    Add it before pages() in a custom worker or server entrypoint that does not run inside App.render, such as a Hono app used directly as a Cloudflare worker. Without it, pages() and middleware() return an empty 404 with an internal X-Astro-Error header for unmatched routes. astro() already includes this handling.

    import { Hono } from 'hono';
    import { notFound, pages } from 'astro/hono';
    import { cf } from '@astrojs/cloudflare/hono';
    
    const app = new Hono();
    app.use(cf());
    app.use(notFound());
    app.use(pages());
    export default app;
  • #​18177 7d814e5 Thanks @​Princesseuh! - Adds support for separate build and runtime image services

    image.service now also accepts a build and a runtime service. The build service optimizes images on prerendered pages when you build your site, and is also used during development. The runtime service handles images on on-demand rendered pages and the image endpoint of your deployed site.

    The following example uses Sharp to optimize images on prerendered pages, and an image CDN for on-demand rendered pages:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      image: {
        service: {
          build: { entrypoint: 'astro/assets/services/sharp' },
          runtime: { entrypoint: 'my-image-cdn-service' },
        },
      },
    });
Changes for integration authors

config.image.service keeps the shape the user configured it with. When a project sets build and runtime services, config.image.service.entrypoint and config.image.service.config are undefined.

If your integration reads image.service, check for the runtime property to get the service you need:

'astro:config:done': ({ config }) => {
  const { service } = config.image;
  const runtimeService = 'runtime' in service ? service.runtime : service;

  if (runtimeService.entrypoint === 'astro/assets/services/sharp') {
    // ...
  }
},

Setting image.service with updateConfig() replaces the existing service instead of merging with it when the two use different shapes. For example, setting a single service in a project that uses build and runtime services replaces both.

  • #​18277 2715958 Thanks @​florian-lefebvre! - Increases the minimum Node.js version to 22.22.0

    The minimum supported Node.js version is now 22.22.0, the latest Node.js 22 release supported by StackBlitz. This change is in line with Astro's Node.js support policy.

  • #​18313 71e2b24 Thanks @​matthewp! - Allows integrations to control where Astro writes client, server, and prerender build output.

    Custom prerenderers can access the final output locations through the new outputDirectories context:

    setPrerenderer((defaultPrerenderer, { outputDirectories }) => {
      const { client, server, prerender } = outputDirectories
    
      return createPrerenderer({
        defaultPrerenderer,
        client,
        server,
        prerender,
      })
    })
  • #​18177 7d814e5 Thanks @​Princesseuh! - Lets custom prerenderers report the images used on prerendered pages

    Astro now generates images on prerendered pages from the image information that a prerenderer's getStaticPaths() and render() return. If your prerenderer wraps Astro's default one, pass this information through:

    setPrerenderer((defaultPrerenderer) => ({
      name: 'my-prerenderer',
      async setup() {
        await defaultPrerenderer.setup?.();
      },
      async getStaticPaths() {
        const result = await defaultPrerenderer.getStaticPaths();
        const { paths, metadata } = Array.isArray(result) ? { paths: result } : result;
        return { paths: paths.filter(({ pathname }) => !pathname.startsWith('/drafts')), metadata };
      },
      render(request, options) {
        return defaultPrerenderer.render(request, options);
      },
      async teardown() {
        await defaultPrerenderer.teardown?.();
      },
    }));

    Returning a plain array from getStaticPaths() or a plain Response from render() still works, but is deprecated: images used on those pages are not generated.

  • #​17932 b905ff1 Thanks @​Princesseuh! - Adds support for experimental parallel prerendering

    This experimental feature makes astro build render your static pages in parallel, using multiple CPU cores at once instead of one. On sites with many pages, this can significantly reduce build times, at the cost of higher memory usage.

    To enable this feature, add the experimental flag in your Astro config:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        parallelPrerender: true,
      },
    });

    By default, Astro uses all available CPU cores but one. Each additional worker increases the memory used by your build. If your build runs out of memory, or does not get faster, set workers to a lower number:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        parallelPrerender: {
          workers: 4,
        },
      },
    });

    Each worker renders as many pages at once as your build.concurrency setting allows.

    This feature has no effect when your adapter provides its own way of prerendering pages. Among official adapters, this only applies to @astrojs/cloudflare. Astro logs a warning during the build when the flag is ignored.

    For more information on enabling and using this feature in your project, see the experimental parallel prerendering docs.

Patch Changes

v7.3.8

Compare Source

Patch Changes
  • #​18293 28e7410 Thanks @​astro-factory! - Fixes Astro.cache being undefined when a custom 404 or 500 page is rendered by the error handler, for example after a request to an API route with an HTTP method the route doesn't export

  • #​18298 0e9e857 Thanks @​matthewp! - Fixes astro add removing existing allowBuilds approvals from pnpm-workspace.yaml with pnpm v11.0–v11.22

  • #​18263 882dd98 Thanks @​florian-lefebvre! - Refactors internal bundling and code transforms to use Vite's Oxc-based transformWithOxc and Rolldown instead of esbuild. These packages no longer depend on esbuild directly.

  • #​18290 31f13c3 Thanks @​astro-factory! - Fixes the glob() loader not reloading changed files in dev when the pattern starts with an extglob such as !(drafts)/**/*.md


Configuration

📅 Schedule: (in timezone Asia/Tokyo)

  • Branch creation
    • At any time (no schedule defined)
  • 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants