fix(deps): update astro to v5.15.6 [security] #266
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

This PR contains the following updates:
5.15.5->5.15.6GitHub Vulnerability Alerts
CVE-2025-64745
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.Details
Vulnerability Location
https://github.com/withastro/astro/blob/5bc37fd5cade62f753aef66efdf40f982379029a/packages/astro/src/template/4xx.ts#L133-L149
Root Cause
The vulnerability was introduced in commit
536175528(PR #12994) , as part of a feature to "redirect trailing slashes on on-demand rendered pages." The feature added a helpful 404 error page in development mode to alert developers of trailing slash mismatches.Issue: The
correctedvariable, which is derived from the user-controlledpathnameparameter, is directly interpolated into the HTML without proper escaping. While thepathnamevariable itself is escaped elsewhere in the same file (line 114:escape(pathname)), thecorrectedvariable is not sanitized before being inserted into both thehrefattribute and the link text.Attack Vector
When a developer has configured
trailingSlashto'always'or'never'and visits a URL with a mismatched trailing slash, the development server returns a 404 page containing the vulnerable template. An attacker can craft a URL with JavaScript payloads that will be executed when the page is rendered.PoC
Local Testing (localhost)
Basic vulnerability verification in local development environment
Show details
astro.config.mjs:package.json:{ "name": "astro-xss-poc-victim", "version": "0.1.0", "scripts": { "dev": "astro dev" }, "dependencies": { "astro": "5.15.5" } }Start the development server:
Access the following malicious URL depending on your configuration:
For
trailingSlash: 'never'(requires trailing slash):For
trailingSlash: 'always'(no trailing slash):When accessing the malicious URL:
alert(document.domain)) executes in the browserRemote Testing (ngrok)
Reproduce realistic attack scenario via external malicious link
Show details
Prerequisites: ngrok account and authtoken configured (
ngrok config add-authtoken <key>)Setup and Execution:
When a remote user accesses either of the generated attack URLs:
alert(document.domain)) executes in the user's browserBoth URL patterns work depending on your
trailingSlashconfiguration ('never' or 'always').Impact
This only affects the development server. Risk depends on how and where the dev server is exposed.
Security impact
localhostendpoints or dev tools depending on browser policies.Attack scenarios
Remediation
The fix is straightforward and requires escaping the
correctedvariable before inserting it into the HTML template. The codebase already imports and uses theescape()function from thehtml-escaperpackage.Release Notes
withastro/astro (astro)
v5.15.6Compare Source
Patch Changes
#14751
18c55e1Thanks @delucis! - Fixes hydration of client components when running the dev server and using a barrel file that re-exports both Astro and UI framework components.#14750
35122c2Thanks @florian-lefebvre! - Updates the experimental Fonts API to log a warning if families with a conflictingcssVariableare provided#14737
74c8852Thanks @Arecsu! - Fixes an error when usingtransition:persistwith components that use declarative Shadow DOM. Astro now avoids re-attaching a shadow root if one already exists, preventing"Unable to re-attach to existing ShadowDOM"navigation errors.#14750
35122c2Thanks @florian-lefebvre! - Updates the experimental Fonts API to allow for more granular configuration of remote font familiesA font family is defined by a combination of properties such as weights and styles (e.g.
weights: [500, 600]andstyles: ["normal", "bold"]), but you may want to download only certain combinations of these.For greater control over which font files are downloaded, you can specify the same font (ie. with the same
cssVariable,name, andproviderproperties) multiple times with different combinations. Astro will merge the results and download only the required files. For example, it is possible to download normal500and600while downloading only italic500:Configuration
📅 Schedule: Branch creation - "" (UTC), 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.
This PR was generated by Mend Renovate. View the repository job log.