Astro Security Advisories, CVEs & Patched Versions
Historical vulnerability disclosures, CVSS severity ratings, affected version ranges, and verified patch releases for Astro.
CVE-2026-126364: Astro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems
Astro: XSS via attribute injection in dynamic tag names
## 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 ta...
0 -> 7.4.5
Astro: Image endpoint in @astrojs/node can read files from a case-variant sibling of the output directory on case-sensitive filesystems
## 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...
0 -> unfixed, 5.14.3 -> 7.4.7
Astro: 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...
0 -> 7.3.2
Astro: 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 delimit...
7.1.0 -> 7.3.3
Astro: 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 Astr...
0 -> 7.2.8
Astro: Authorization bypass from missing path-segment boundary check when stripping the configured base
## Summary Astro stripped a configured `base` path from request pathnames using a string-prefix check that did not verify a path-segment boundary. With `base: "/app"`, a request to `/appX/admin` was treated as being under the base and resolved internally to the `/admin` route...
0 -> 7.2.4
Astro: composable `astro/hono` pipeline bypasses `security.checkOrigin` when `middleware()` is absent or misordered
## Summary In the composable `astro/hono` pipeline, the `security.checkOrigin` protection is only installed by the `middleware()` primitive. The `actions()` and `pages()` primitives each dispatch to user code independently, so a pipeline that mounts either primitive before (o...
7.0.0 -> 7.0.6
Astro: 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_CHAR` guard to `addAttribute()` so that spread-prop attribute names containing `"' >/=` or whitespace are dropped. A second attribute-rendering path, `renderHTMLElement()` in `packages/ast...
0 -> 7.0.6
Astro: Cross-site scripting via unescaped transition:* directive values on hydrated islands
### Summary When a `transition:persist`, `transition:scope`, or `transition:persist-props` directive 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 develope...
3.10.0 -> 7.0.4
Astro: Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
# Astro 6.4.7 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...
6.4.7 -> 6.4.8
Astro: 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 `duration` can contain a ...
2.9.0 -> 7.1.0
Astro: XSS via Unescaped Attribute Names in Spread Props
## Summary The `spreadAttributes` function in Astro's server-side rendering pipeline iterates over object keys and passes them directly to `addAttribute`, which interpolates the key into the HTML output without escaping. When a developer uses the spread syntax `{...props}` on...
0 -> 6.4.6
Astro: Host header SSRF in prerendered error page fetch
## Summary Astro SSR apps with prerendered error pages (`/404` or `/500` using `export const prerender = true`) fetch those pages over HTTP at runtime when an error occurs. The URL for this fetch is derived from `request.url`, which in turn gets its origin from the incoming `...
0 -> 6.4.6
Astro: Reflected XSS via unescaped slot name
## Summary When a component uses a `client:*` directive, Astro inserts named slot content into a `data-astro-template` attribute without HTML escaping the slot name allowing an attacker to break out of the attribute context and inject arbitrary HTML, resulting in reflected XS...
0 -> 6.3.3
Astro: 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 en...
0 -> 6.1.10
Astro: XSS in define:vars via incomplete </script> tag sanitization
## Summary The `defineScriptVars` function in Astro's server-side rendering pipeline uses a case-sensitive regex `/<\/script>/g` to sanitize values injected into inline `<script>` tags via the `define:vars` directive. HTML parsers close `<script>` elements case-insensitively ...
0 -> 6.1.6
Astro: Remote allowlist bypass via unanchored matchPathname wildcard
## Summary This issue concerns Astro's `remotePatterns` path 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 ...
2.10.10 -> 5.18.1
Astro has an Authentication Bypass via Double URL Encoding, a bypass for CVE-2025-64765
# Authentication Bypass via Double URL Encoding in Astro ## Bypass for CVE-2025-64765 / GHSA-ggxq-hp9w-j794 --- ### Summary A **double URL encoding bypass** allows any unauthenticated attacker to bypass path-based authentication checks in Astro middleware, granting unauthor...
0 -> 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 with `output: 'server'`. The built-in image optimization endpoint (`/_image`) uses `isRemoteAllowed()` from Astro’s internal helpers, which **unconditionally...
0 -> 5.15.9
Astro's middleware authentication checks based on url.pathname can be bypassed via url encoded values
A mismatch exists between how Astro normalizes request paths for routing/rendering and how the application’s middleware reads the path for validation checks. Astro internally applies `decodeURI()` to determine which route to render, while the middleware uses `context.url.pathn...
0 -> 5.15.8
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 c...
0 -> 5.15.8
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 im...
0 -> 5.14.3
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](https://docs.astro.build/en/guides/on-demand-rendering/), request headers `x-forwarded-proto` and `x-forwarded-port` are insecurely used, without sanitization, to build the URL. This has several consequences...
2.16.0 -> 5.15.5
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 `trailingSlash` configuration option is used. An attacker can inject arbitrary JavaScript code that executes in the victim's browser context by crafting a...
5.2.0 -> 5.15.6
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](https://github.com/withastro/astro/commit/9ecf3598e2b29dd74614328fde3047ea90e67252). The fix blocks `http://`, `https://` and `//`, but can be bypassed using backslashes (`\`) - the endpoint still issues...
5.13.4 -> 5.13.10
Astro's `X-Forwarded-Host` is reflected without validation
### Summary 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-Host` header that is reflected when using the recommended `Astro.url` property as there is no validation that the value is saf...
0 -> 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 `/_image` endpoint w...
5.0.0-alpha.0 -> 5.13.2, 0 -> 9.1.1, 0 -> 4.16.19
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/`....
5.2.0 -> 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...
5.0.0-alpha.0 -> 5.0.8, 0 -> 4.16.18
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.checkOrigin` configuration option is set to `true`, Astro middleware will perform a CSRF check. (Source code: https://github.com/withastro/astro/blo...
0 -> 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., `iframe` tags with unsanitized ...
3.0.0 -> 4.16.1