astro
7.4.13 · 18 Nov 2026MIT12.5M / weekRepositoryHomepagenpmAtom feed
4.16.19 is the newest release of 4.x.
In short
8 new6 fixed1 internal
Security
24 advisories affect 4.12.0; 7.4.5 fixes them
- CriticalAstro: Remote code execution through AVIF image optimizationGHSA-26w7-cxv4-gfx2 · 8 Sep 2026Fixed in 7.2.8
- HighAstro: Host header SSRF in prerendered error page fetchGHSA-2pvr-wf23-7pc7 · 16 Jun 2026Fixed in 6.4.6
- HighAstro: Reflected XSS via unescaped slot nameGHSA-8hv8-536x-4wqp · 16 Jun 2026Fixed in 6.3.3
- HighAstro vulnerable to reflected XSS via the server islands featureGHSA-wrwg-2hg8-v723 · 19 Nov 2025Fixed in 5.15.8
- HighAstro's server source code is exposed to the public if sourcemaps are enabledGHSA-49w6-73cw-chjr · 19 Dec 2024Fixed in 4.16.18
19 more
- ModerateAstro: Reflected/Stored XSS via unescaped <script>/<style> tag content in JSX/MDX renderingGHSA-98hj-9722-w3j8 · 22 Oct 2026Fixed in 7.3.2
- ModerateAstro: Authorization bypass from missing path-segment boundary check when stripping the configured baseGHSA-376h-93r7-7g6f · 8 Sep 2026Fixed in 7.2.4
- ModerateAstro: XSS via unescaped spread attribute names in renderHTMLElement (incomplete fix for CVE-2026-54298)GHSA-f48w-9m4c-m7f5 · 20 Jul 2026Fixed in 7.0.6
- ModerateAstro: Reflected XSS via unescaped View Transition animation propertiesGHSA-4g3v-8h47-v7g6 · 20 Jul 2026Fixed in 7.1.0
- ModerateAstro: XSS via Unescaped Attribute Names in Spread PropsGHSA-jrpj-wcv7-9fh9 · 16 Jun 2026Fixed in 6.4.6
- ModerateAstro: XSS in define:vars via incomplete </script> tag sanitizationGHSA-j687-52p2-xcff · 21 Apr 2026Fixed in 6.1.6
- ModerateAstro has an Authentication Bypass via Double URL Encoding, a bypass for CVE-2025-64765GHSA-whqg-ppgf-wp8c · 8 Dec 2025Fixed in 5.15.8
- ModerateAstro Cloudflare adapter has Stored Cross-site Scripting vulnerability in /_image endpointGHSA-fvmw-cj7j-j39q · 19 Nov 2025Fixed in 5.15.9
- ModerateAstro's middleware authentication checks based on url.pathname can be bypassed via url encoded valuesGHSA-ggxq-hp9w-j794 · 19 Nov 2025Fixed in 5.15.8
- ModerateAstro vulnerable to URL manipulation via headers, leading to middleware and CVE-2025-61925 bypassGHSA-hr2q-hp5q-x767 · 13 Nov 2025Fixed in 5.15.5
- ModerateAstro's `X-Forwarded-Host` is reflected without validationGHSA-5ff5-9fcw-vg88 · 10 Oct 2025Fixed in 5.14.3
- ModerateAstro allows unauthorized third-party images in _image endpointGHSA-xf8x-j4p2-f749 · 19 Aug 2025Fixed in 4.16.19
- ModerateAtro CSRF Middleware Bypass (security.checkOrigin)GHSA-c4pw-33h3-35xw · 18 Dec 2024Fixed in 4.16.17
- ModerateDOM Clobbering Gadget found in astro's client-side router that leads to XSSGHSA-m85w-3h95-hcf9 · 14 Oct 2024Fixed in 4.16.1
- LowAstro: XSS via attribute injection in dynamic tag namesGHSA-mh32-jxcr-mh9f · 13 Nov 2026Fixed in 7.4.5
- LowAstro: Cross-site scripting via unescaped transition:* directive values on hydrated islandsGHSA-7pw4-f3q4-r2p2 · 20 Jul 2026Fixed in 7.0.4
- LowAstro: Server island encrypted parameters vulnerable to cross-component replayGHSA-xr5h-phrj-8vxv · 13 May 2026Fixed in 6.1.10
- LowAstro: Remote allowlist bypass via unanchored matchPathname wildcardGHSA-g735-7g2w-hh3f · 26 Mar 2026Fixed in 5.18.1
- LowAstro Development Server has Arbitrary Local File ReadGHSA-x3h8-62x9-952g · 19 Nov 2025Fixed in 5.14.3
Release note
Minor Changes
Adds support for Shiki's
defaultColoroption.This option allows you to override the values of a theme's inline style, adding only CSS variables to give you more flexibility in applying multiple color themes.
Configure
defaultColor: falsein your Shiki config to apply throughout your site, or pass to Astro's built-in<Code>component to style an individual code block.import { defineConfig } from 'astro/config'; export default defineConfig({ markdown: { shikiConfig: { themes: { light: 'github-light', dark: 'github-dark', }, defaultColor: false, }, }, });--- import { Code } from 'astro:components'; --- <Code code={`const useMyColors = true`} lang="js" defaultColor={false} />Refactors the type for integration hooks so that integration authors writing custom integration hooks can now allow runtime interactions between their integration and other integrations.
This internal change should not break existing code for integration authors.
To declare your own hooks for your integration, extend the
Astro.IntegrationHooksinterface:// your-integration/types.ts declare global { namespace Astro { interface IntegrationHooks { 'myLib:eventHappened': (your: string, parameters: number) => Promise<void>; } } }Call your hooks on all other integrations installed in a project at the appropriate time. For example, you can call your hook on initialization before either the Vite or Astro config have resolved:
// your-integration/index.ts import './types.ts'; export default (): AstroIntegration => { return { name: 'your-integration', hooks: { 'astro:config:setup': async ({ config }) => { for (const integration of config.integrations) { await integration.hooks['myLib:eventHappened'].?('your values', 123); } }, } } }Other integrations can also now declare your hooks:
// other-integration/index.ts import 'your-integration/types.ts'; export default (): AstroIntegration => { return { name: 'other-integration', hooks: { 'myLib:eventHappened': async (your, values) => { // ... }, }, }; };Experimental Server Islands
Server Islands allow you to specify components that should run on the server, allowing the rest of the page to be more aggressively cached, or even generated statically. Turn any
.astrocomponent into a server island by adding theserver:deferdirective and optionally, fallback placeholder content:--- import Avatar from '../components/Avatar.astro'; import GenericUser from '../components/GenericUser.astro'; --- <header> <h1>Page Title</h1> <div class="header-right"> <Avatar server:defer> <GenericUser slot="fallback" /> </Avatar> </div> </header>The
server:deferdirective can be used on any Astro component in a project usinghybridorservermode with an adapter. There are no special APIs needed inside of the island.Enable server islands by adding the experimental flag to your Astro config with an appropriate
outputmode and adatper:import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify'; export default defineConfig({ output: 'hybrid', adapter: netlify(), experimental { serverIslands: true, }, });For more information, see the server islands documentation.
Adds a
--noSyncparameter to theastro checkcommand to skip the type-gen step. This can be useful when runningastro checkinside packages that have Astro components, but are not Astro projectsAdds a new
inferRemoteSize()function that can be used to infer the dimensions of a remote image.Previously, the ability to infer these values was only available by adding the [
inferSize] attribute to the<Image>and<Picture>components orgetImage(). Now, you can also access this data outside of these components.This is useful for when you need to know the dimensions of an image for styling purposes or to calculate different densities for responsive images.
--- import { inferRemoteSize, Image } from 'astro:assets'; const imageUrl = 'https://...'; const { width, height } = await inferRemoteSize(imageUrl); --- <Image src={imageUrl} width={width / 2} height={height} densities={[1.5, 2]} />Adds Shiki's
defaultColoroption to the<Code />component, giving you more control in applying multiple themesAdds two new values to the pagination
pageprop:page.firstandpage.lastfor accessing the URLs of the first and last pages.
Patch Changes
Fixes an issue where the development server was emitting a 404 status code when the user uses a rewrite that emits a 200 status code.
Fixes a case where invalid
astro:envvariables at runtime would not throw correctlyMove root inside the manifest and make serialisable
Refactors how
syncworks and when it's called. Fixes an issue withastro:envtypes in dev not being generatedSupports importing Astro components with Vite queries, like
?url,?raw, and?directFix for Server Islands in Vercel adapter
Vercel, and probably other adapters only allow pre-defined routes. This makes it so that the
astro:build:donehook includes the_server-islands/route as part of the route data, which is used to configure available routes.Fixes Astro not working on low versions of Node 18 and 20
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.