astro
7.4.13 · 18 Nov 2026MIT12.5M / weekRepositoryHomepagenpmAtom feed
4.16.19 is the newest release of 4.x.
In short
7 new6 fixed
Security
24 advisories affect 4.8.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
Exports
astro/jsx/rehype.jswith utilities to generate an Astro metadata objectAdds the ability for multiple pages to use the same component as an
entrypointwhen building an Astro integration. This change is purely internal, and aligns the build process with the behaviour in the development server.Adds a new radio checkbox component to the dev toolbar UI library (
astro-dev-toolbar-radio-checkbox)Adds support for passing an inline Astro configuration object to
getViteConfig()If you are using
getViteConfig()to configure the Vitest test runner, you can now pass a second argument to control how Astro is configured. This makes it possible to configure unit tests with different Astro options when using Vitest’s workspaces feature.// vitest.config.ts import { getViteConfig } from 'astro/config'; export default getViteConfig( /* Vite configuration */ { test: {} }, /* Astro configuration */ { site: 'https://example.com', trailingSlash: 'never', } );Adds experimental rewriting in Astro with a new
rewrite()function and the middlewarenext()function.The feature is available via an experimental flag in
astro.config.mjs:export default defineConfig({ experimental: { rewriting: true, }, });When enabled, you can use
rewrite()to render another page without changing the URL of the browser in Astro pages and endpoints.--- // src/pages/dashboard.astro if (!Astro.props.allowed) { return Astro.rewrite('/'); } ---// src/pages/api.js export function GET(ctx) { if (!ctx.locals.allowed) { return ctx.rewrite('/'); } }The middleware
next()function now accepts a parameter with the same type as therewrite()function. For example, withnext("/"), you can call the next middleware function with a newRequest.// src/middleware.js export function onRequest(ctx, next) { if (!ctx.cookies.get('allowed')) { return next('/'); // new signature } return next(); }NOTE: please read the RFC to understand the current expectations of the new APIs.
Adds experimental support for the Actions API. Actions let you define type-safe endpoints you can query from client components with progressive enhancement built in.
Actions help you write type-safe backend functions you can call from anywhere. Enable server rendering using the
outputproperty and add theactionsflag to theexperimentalobject:{ output: 'hybrid', // or 'server' experimental: { actions: true, }, }Declare all your actions in
src/actions/index.ts. This file is the global actions handler.Define an action using the
defineAction()utility from theastro:actionsmodule. These accept thehandlerproperty to define your server-side request handler. If your action accepts arguments, apply theinputproperty to validate parameters with Zod.This example defines two actions:
likeandcomment. Thelikeaction accepts a JSON object with apostIdstring, while thecommentaction accepts FormData withpostId,author, andbodystrings. Eachhandlerupdates your database and return a type-safe response.// src/actions/index.ts import { defineAction, z } from 'astro:actions'; export const server = { like: defineAction({ input: z.object({ postId: z.string() }), handler: async ({ postId }, context) => { // update likes in db return likes; }, }), comment: defineAction({ accept: 'form', input: z.object({ postId: z.string(), body: z.string(), }), handler: async ({ postId }, context) => { // insert comments in db return comment; }, }), };Then, call an action from your client components using the
actionsobject fromastro:actions. You can pass a type-safe object when using JSON, or a FormData object when usingaccept: 'form'in your action definition:// src/components/blog.tsx import { actions } from 'astro:actions'; import { useState } from 'preact/hooks'; export function Like({ postId }: { postId: string }) { const [likes, setLikes] = useState(0); return ( <button onClick={async () => { const newLikes = await actions.like({ postId }); setLikes(newLikes); }} > {likes} likes </button> ); } export function Comment({ postId }: { postId: string }) { return ( <form onSubmit={async (e) => { e.preventDefault(); const formData = new FormData(e.target); const result = await actions.blog.comment(formData); // handle result }} > <input type="hidden" name="postId" value={postId} /> <label for="author">Author</label> <input id="author" type="text" name="author" /> <textarea rows={10} name="body"></textarea> <button type="submit">Post</button> </form> ); }For a complete overview, and to give feedback on this experimental API, see the Actions RFC.
Adds a new
buttonBorderRadiusproperty to theastro-dev-toolbar-buttoncomponent for the dev toolbar component library. This property can be useful to make a fully rounded button with an icon in the center.
Patch Changes
Improve error message when accessing
clientAddresson prerendered routesImproves the error message when failed to render MDX components
Fixes a case where the local server would crash when the host also contained the port, eg. with
X-Forwarded-Host: hostname:8080andX-Forwarded-Port: 8080headersRefactors internal handling of styles and scripts for content collections to improve build performance
Preserve content modules properly in cache
Handles
AstroUserErrors thrown while syncing content collections and exportsBaseSchemaandCollectionConfigtypes
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.