Security changelog
Astro has 28 published advisories, 7 high or critical.
When a framework publishes a security advisory, this page tracks the details teams need for patch triage: affected ranges, fixed versions, CVEs, workarounds, severity, and the original advisory. Feature releases and routine changelog noise stay out.
-
Arbitrary CSS injection in Astro View Transitions
Summary
Astro’s server-side View Transition CSS generator did not keep string animation properties within their generated CSS declarations. In an application that passes attacker-controlled data into an animation property such as
duration, a value containing CSS delimiters could terminate the declaration and rule, then add attacker-selected CSS to the server-rendered page.The injected content remains inside the generated
<style>element.- >= 7.1.0, <= 7.3.2
Low Fixed in 7.3.3
-
Reflected/Stored XSS via unescaped <script>/<style> tag content in JSX/MDX rendering
Summary
Astro’s JSX and MDX rendering pipeline treated string children of
<script>and<style>elements as trusted HTML. When a dynamic value was passed through a JSX expression, such as<script>{value}</script>, an attacker-controlled value containing</script>or</style>could terminate the element and inject arbitrary HTML and JavaScript.Other JSX expression contexts escaped dynamic strings automatically.
- < 7.3.2
Medium Fixed in 7.3.2
-
Authorization bypass from missing path-segment boundary check when stripping the configured base
Summary
Astro stripped a configured
basepath from request pathnames using a string-prefix check that did not verify a path-segment boundary. Withbase: "/app", a request to/appX/adminwas treated as being under the base and resolved internally to the/adminroute, while middleware still observed the public pathname/appX/admin. Middleware that authorizes routes by inspectingcontext.url.pathnamecould therefore be bypassed.- <= 7.2.3
Medium Fixed in 7.2.4
-
Remote code execution through AVIF image optimization
A vulnerability in
libheif, used by the default Sharp image service in Astro, can lead to remote code execution when a malicious AVIF image is optimized.Projects are affected when an attacker can cause Astro to process an untrusted AVIF image.
The fix was released in Astro 7.2.8, which requires Sharp 0.35.4.
- < 7.2.8
Critical Fixed in 7.2.8
-
Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
Summary
Astro 6.4.7 appears to reintroduce a middleware authorization bypass pattern when a request path is encoded more deeply than the newly introduced iterative URL decoder’s maximum decoding depth.
- >= 6.4.7, < 6.4.8
High Fixed in 6.4.8
-
composable
astro/honopipeline bypassessecurity.checkOriginwhenmiddleware()is absent or misorderedSummary
In the composable
astro/honopipeline, thesecurity.checkOriginprotection is only installed by themiddleware()primitive. Theactions()andpages()primitives each dispatch to user code independently, so a pipeline that mounts either primitive before (or without)middleware()will bypass the origin check for those requests.Details
security.checkOrigin(default:true) is intended to reject cross-sitePOST/PUT/PATCH/DELETEform submissions.- >= 7.0.0, < 7.0.6
Medium Fixed in 7.0.6
-
Cross-site scripting via unescaped transition:* directive values on hydrated islands
Summary
When a
transition:persist,transition:scope, ortransition:persist-propsdirective is applied to a client-hydrated (client:*) component, Astro copied the directive value onto the rendered<astro-island>element without HTML-escaping it. If a developer reflects attacker-controlled input into one of these directives, an attacker can break out of the attribute and inject arbitrary HTML/JavaScript into the server-rendered output, resulting in reflected cross-site scripting (XSS).- >= 3.10.0, < 7.0.4
Low Fixed in 7.0.4
-
Reflected XSS via unescaped View Transition animation properties
Summary
Astro’s server-side View Transition CSS generator interpolates animation properties into an inline
<style>element without escaping them for the CSS and HTML contexts.An attacker-controlled value passed to an animation property such as
durationcan contain a</style>sequence, terminate the generated style element, and inject arbitrary HTML or JavaScript.- >= 2.9.0, <= 7.0.9
Medium Fixed in 7.1.0
-
XSS via unescaped spread attribute names in renderHTMLElement (incomplete fix for CVE-2026-54298)
Summary
The fix for CVE-2026-54298 (GHSA-jrpj-wcv7-9fh9) added an
INVALID_ATTR_NAME_CHARguard toaddAttribute()so that spread-prop attribute names containing"' >/=or whitespace are dropped. A second attribute-rendering path,renderHTMLElement()inpackages/astro/src/runtime/server/render/dom.ts, has its own inline attribute loop that does not go throughaddAttribute()and was not updated.- < 7.0.6
Medium Fixed in 7.0.6
-
Host header SSRF in prerendered error page fetch
Summary
Astro SSR apps with prerendered error pages (
/404or/500usingexport const prerender = true) fetch those pages over HTTP at runtime when an error occurs. The URL for this fetch is derived fromrequest.url, which in turn gets its origin from the incomingHostheader. When theHostheader is not validated againstallowedDomains, an attacker can point the fetch at an arbitrary host and read the response.Who is affected
This affects SSR deployments that:
- < 6.4.6
High Fixed in 6.4.6
-
Reflected XSS via unescaped slot name
Summary
When a component uses a
client:*directive, Astro inserts named slot content into adata-astro-templateattribute without HTML escaping the slot name allowing an attacker to break out of the attribute context and inject arbitrary HTML, resulting in reflected XSS during SSR.This is similar to GHSA-wrwg-2hg8-v723 but exploits a different injection point.
Vulnerable Code
packages/astro/src/runtime/server/render/component.ts:371:376- < 6.3.3
High Fixed in 6.3.3
-
XSS via Unescaped Attribute Names in Spread Props
Summary
The
spreadAttributesfunction in Astro’s server-side rendering pipeline iterates over object keys and passes them directly toaddAttribute, which interpolates the key into the HTML output without escaping.- < 6.4.6
Medium Fixed in 6.4.6
-
Server island encrypted parameters vulnerable to cross-component replay
Impact
Astro versions prior to 6.1.10 used AES-GCM encryption to protect the confidentiality and integrity of server island props and slots parameters, but did not bind the ciphertext to its intended component or parameter type. An attacker could replay one component’s encrypted props (
p) value as another component’s slots (s) value, or vice versa.- < 6.1.10
Low Fixed in 6.1.10
-
XSS in define:vars via incomplete </script> tag sanitization
Summary
The
defineScriptVarsfunction in Astro’s server-side rendering pipeline uses a case-sensitive regex/<\/script>/gto sanitize values injected into inline<script>tags via thedefine:varsdirective. HTML parsers close<script>elements case-insensitively and also accept whitespace or/before the closing>, allowing an attacker to bypass the sanitization with payloads like</Script>,</script >, or</script/>and inject arbitrary HTML/JavaScript.- < 6.1.6
Medium Fixed in 6.1.6
-
Remote allowlist bypass via unanchored matchPathname wildcard
Summary
This issue concerns Astro’s
remotePatternspath enforcement for remote URLs used by server-side fetchers such as the image optimization endpoint. The path matching logic for/*wildcards is unanchored, so a pathname that contains the allowed prefix later in the path can still match. As a result, an attacker can fetch paths outside the intended allowlisted prefix on an otherwise allowed host.- >= 2.10.10, < 5.18.1
Low Fixed in 5.18.1
-
Astro has an Authentication Bypass via Double URL Encoding, a bypass for CVE-2025-64765
Summary
A double URL encoding bypass allows any unauthenticated attacker to bypass path-based authentication checks in Astro middleware, granting unauthorized access to protected routes. While the original CVE-2025-64765 (single URL encoding) was fixed in v5.15.8, the fix is insufficient as it only decodes once.
- < 5.15.8
Medium Fixed in 5.15.8
-
Astro Cloudflare adapter has Stored Cross-site Scripting vulnerability in /_image endpoint
Summary
A Cross-Site Scripting (XSS) vulnerability exists in Astro when using the @astrojs/cloudflare adapter withoutput: 'server'. The built-in image optimization endpoint (/_image) usesisRemoteAllowed()from Astro’s internal helpers, which unconditionally allowsdata:URLs.- < 5.15.9
Medium Fixed in 5.15.9
-
Astro Development Server has Arbitrary Local File Read
Summary
A vulnerability has been identified in the Astro framework’s development server that allows arbitrary local file read access through the image optimization endpoint. The vulnerability affects Astro development environments and allows remote attackers to read any image file accessible to the Node.js process on the host system.
Details
- Title: Arbitrary Local File Read in Astro Development Image Endpoint
- < 5.14.3
Low Fixed in 5.14.3
-
Astro vulnerable to reflected XSS via the server islands feature
Summary
After some research it appears that it is possible to obtain a reflected XSS when the server islands feature is used in the targeted application, regardless of what was intended by the component template(s).
Details
Server islands run in their own isolated context outside of the page request and use the following pattern path to hydrate the page:
/_server-islands/[name]. These paths can be called via GET or POST and use three parameters:e: component to export
- <= 5.15.6
High Fixed in 5.15.8
-
Astro development server error page is vulnerable to reflected Cross-site Scripting
Summary
A Reflected Cross-Site Scripting (XSS) vulnerability exists in Astro’s development server error pages when the
trailingSlashconfiguration option is used. An attacker can inject arbitrary JavaScript code that executes in the victim’s browser context by crafting a malicious URL. While this vulnerability only affects the development server and not production builds, it could be exploited to compromise developer environments through social engineering or malicious links.- >= 5.2.0, < 5.15.6
Low Fixed in 5.15.6
-
Astro vulnerable to URL manipulation via headers, leading to middleware and CVE-2025-61925 bypass
Summary
In impacted versions of Astro using on-demand rendering, request headers
x-forwarded-protoandx-forwarded-portare insecurely used, without sanitization, to build the URL. This has several consequences the most important of which are:- Middleware-based protected route bypass (only via
x-forwarded-proto) - DoS via cache poisoning (if a CDN is present)
- SSRF (only via
x-forwarded-proto)
- >= 2.16.0, < 5.15.5
Medium Fixed in 5.15.5
- Middleware-based protected route bypass (only via
-
Astro’s bypass of image proxy domain validation leads to SSRF and potential XSS
Summary
This is a patch bypass of CVE-2025-58179 in commit 9ecf359. The fix blocks
http://,https://and//, but can be bypassed using backslashes (\) - the endpoint still issues a server-side fetch.- >= 5.13.4, < 5.13.10
High Fixed in 5.13.10
-
Astro’s
X-Forwarded-Hostis reflected without validationSummary
When running Astro in on-demand rendering mode using a adapter such as the node adapter it is possible to maliciously send an
X-Forwarded-Hostheader that is reflected when using the recommendedAstro.urlproperty as there is no validation that the value is safe.Details
Astro reflects the value in
X-Forwarded-Hostin output when usingAstro.urlwithout any validation.- < 5.14.3
Medium Fixed in 5.14.3
-
Astro allows unauthorized third-party images in _image endpoint
Summary
In affected versions of
astro, the image optimization endpoint in projects deployed with on-demand rendering allows images from unauthorized third-party domains to be served.Details
On-demand rendered sites built with Astro include an
/_imageendpoint which returns optimized versions of images.- <= 4.16.18
- >= 5.0.0-alpha.0, < 5.13.2
Medium Fixed in 4.16.19, 5.13.2
-
Astros’s duplicate trailing slash feature leads to an open redirection security issue
Summary
There is an Open Redirection vulnerability in the trailing slash redirection logic when handling paths with double slashes. This allows an attacker to redirect users to arbitrary external domains by crafting URLs such as
https://mydomain.com//malicious-site.com/. This increases the risk of phishing and other social engineering attacks.This affects Astro >=5.2.0 sites that use on-demand rendering (SSR) with the Node or Cloudflare adapter.
- >= 5.2.0, < 5.12.8
Medium Fixed in 5.12.8
-
Astro’s server source code is exposed to the public if sourcemaps are enabled
Summary
A bug in the build process allows any unauthenticated user to read parts of the server source code.
Details
During build, along with client assets such as css and font files, the sourcemap files for the server code are moved to a publicly-accessible folder. https://github.com/withastro/astro/blob/176fe9f113fd912f9b61e848b00bbcfecd6d5c2c/packages/astro/src/core/build/static-build.ts#L139
- <= 4.16.17
- >= 5.0.0-alpha.0, < 5.0.8
High Fixed in 4.16.18, 5.0.8
-
Atro CSRF Middleware Bypass (security.checkOrigin)
Summary
A bug in Astro’s CSRF-protection middleware allows requests to bypass CSRF checks.
Details
When the
security.checkOriginconfiguration option is set totrue, Astro middleware will perform a CSRF check. (Source code: https://github.com/withastro/astro/blob/6031962ab5f56457de986eb82bd24807e926ba1b/packages/astro/src/core/app/middlewares.ts)- < 4.16.17
Medium Fixed in 4.16.17
-
DOM Clobbering Gadget found in astro’s client-side router that leads to XSS
Summary
A DOM Clobbering gadget has been discoverd in Astro’s client-side router. It can lead to cross-site scripting (XSS) in websites enables Astro’s client-side routing and has stored attacker-controlled scriptless HTML elements (i.e.,
iframetags with unsanitizednameattributes) on the destination pages.Details
Backgrounds
DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g.
- >= 3.0.0, < 4.16.1
Medium Fixed in 4.16.1