CVE-2025-64525
Astro: URL manipulation via unsanitized headers leads to path-based middleware protections bypass, potential SSRF/cache-poisoning, CVE-2025-61925 bypass
Astro is a web framework. In Astro versions 2.16.0 up to but excluding 5.15.5 which utilizeon-demand rendering, request headers x-forwarded-proto and x-forwarded-port are 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), URL pollution (potential SXSS, if a CDN is present), and WAF bypass. Version 5.15.5 contains a patch.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
6.5
Astro: URL manipulation via unsanitized headers leads to path-based middleware protections bypass, potential SSRF/cache-poisoning, CVE-2025-61925 bypass
Astro is a web framework. In Astro versions 2.16.0 up to but excluding 5.15.5 which utilizeon-demand rendering, request headers x-forwarded-proto and x-forwarded-port are 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), URL pollution (potential SXSS, if a CDN is present), and WAF bypass. Version 5.15.5 contains a patch.
- Record
CVE-2025-64525- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
EUVDEUVD-2025-175298
6.5
Astro is a web framework. In Astro versions 2.16.0 up to but excluding 5.15.5 which utilizeon-demand rendering, request headers x-forwarded-proto and x-forwarded-port are 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), URL pollution (potential SXSS, if a CDN is present), and WAF bypass. Version 5.15.5 contains a patch.
- Record
EUVD-2025-175298- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-hr2q-hp5q-x767
6.5
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-proto and x-forwarded-port are 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) - URL pollution (potential SXSS, if a CDN is present)
- WAF bypass
Details
The x-forwarded-proto and x-forwarded-port headers are used without sanitization in two parts of the Astro server code. The most important is in the createRequest() function. Any configuration, including the default one, is affected:
https://github.com/withastro/astro/blob/970ac0f51172e1e6bff4440516a851e725ac3097/packages/astro/src/core/app/node.ts#L97 https://github.com/withastro/astro/blob/970ac0f51172e1e6bff4440516a851e725ac3097/packages/astro/src/core/app/node.ts#L121
These header values are then used directly to construct URLs.
By injecting a payload at the protocol level during URL creation (via the x-forwarded-proto header), the entire URL can be rewritten, including the host, port and path, and then pass the rest of the URL, the real hostname and path, as a query so that it doesn't affect (re)routing.
If the following header value is injected when requesting the path /ssr:
x-forwarded-proto: https://www.malicious-url.com/?tank=
The complete URL that will be created is: https://www.malicious-url.com/?tank=://localhost/ssr
As a reminder, URLs are created like this:
url = new URL(`${protocol}://${hostnamePort}${req.url}`);
The value is injected at the beginning of the string (${protocol}), and ends with a query ?tank= whose value is the rest of the string, ://${hostnamePort}${req.url}.
This way there is control over the routing without affecting the path, and the URL can be manipulated arbitrarily. This behavior can be exploited in various ways, as will be seen in the PoC section.
The same logic applies to x-forwarded-port, with a few differences.
[!NOTE] The
createRequestfunction is called every time a non-static page is requested. Therefore, all non-static pages are exploitable for reproducing the attack.
PoC
The PoC will be tested with a minimal repository:
- Latest Astro version at the time (
2.16.0) - The Node adapter
- Two simple pages, one SSR (
/ssr), the other simulating an admin page (/admin) protected by a middleware - A middleware example copied and pasted from the official Astro documentation to protect the admin page based on the path
Middleware-based protected route bypass - x-forwarded-proto only
The middleware has been configured to protect the /admin route based on the official documentation:
// src/middleware.ts
import { defineMiddleware } from "astro/middleware";
export const onRequest = defineMiddleware(async (context, next) => {
const isAuthed = false; // auth logic
if (context.url.pathname === "/admin" && !isAuthed) {
return context.redirect("/");
}
return next();
});
-
When tryint to access
/adminthe attacker is naturally redirected :curl -i http://localhost:4321/admin<img width="620" height="102" alt="image" src="https://github.com/user-attachments/assets/15a7bffc-ee56-4ed9-84b2-091cf4d78351" />
-
The attackr can bypass the middleware path check using a malicious header value:
curl -i -H "x-forwarded-proto: x:admin?" http://localhost:4321/admin
…
- Record
GHSA-hr2q-hp5q-x767- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
NVD
6.5
Astro is a web framework. In Astro versions 2.16.0 up to but excluding 5.15.5 which utilizeon-demand rendering, request headers x-forwarded-proto and x-forwarded-port are 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), URL pollution (potential SXSS, if a CDN is present), and WAF bypass. Version 5.15.5 contains a patch.
- Record
CVE-2025-64525- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
OSV
6.5
Astro: URL manipulation via unsanitized headers leads to path-based middleware protections bypass, potential SSRF/cache-poisoning, CVE-2025-61925 bypass
Astro is a web framework. In Astro versions 2.16.0 up to but excluding 5.15.5 which utilizeon-demand rendering, request headers x-forwarded-proto and x-forwarded-port are 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), URL pollution (potential SXSS, if a CDN is present), and WAF bypass. Version 5.15.5 contains a patch.
- Record
CVE-2025-64525- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
OSVGHSA-hr2q-hp5q-x767
6.5
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-proto and x-forwarded-port are 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) - URL pollution (potential SXSS, if a CDN is present)
- WAF bypass
Details
The x-forwarded-proto and x-forwarded-port headers are used without sanitization in two parts of the Astro server code. The most important is in the createRequest() function. Any configuration, including the default one, is affected:
https://github.com/withastro/astro/blob/970ac0f51172e1e6bff4440516a851e725ac3097/packages/astro/src/core/app/node.ts#L97 https://github.com/withastro/astro/blob/970ac0f51172e1e6bff4440516a851e725ac3097/packages/astro/src/core/app/node.ts#L121
These header values are then used directly to construct URLs.
By injecting a payload at the protocol level during URL creation (via the x-forwarded-proto header), the entire URL can be rewritten, including the host, port and path, and then pass the rest of the URL, the real hostname and path, as a query so that it doesn't affect (re)routing.
If the following header value is injected when requesting the path /ssr:
x-forwarded-proto: https://www.malicious-url.com/?tank=
The complete URL that will be created is: https://www.malicious-url.com/?tank=://localhost/ssr
As a reminder, URLs are created like this:
url = new URL(`${protocol}://${hostnamePort}${req.url}`);
The value is injected at the beginning of the string (${protocol}), and ends with a query ?tank= whose value is the rest of the string, ://${hostnamePort}${req.url}.
This way there is control over the routing without affecting the path, and the URL can be manipulated arbitrarily. This behavior can be exploited in various ways, as will be seen in the PoC section.
The same logic applies to x-forwarded-port, with a few differences.
[!NOTE] The
createRequestfunction is called every time a non-static page is requested. Therefore, all non-static pages are exploitable for reproducing the attack.
PoC
The PoC will be tested with a minimal repository:
- Latest Astro version at the time (
2.16.0) - The Node adapter
- Two simple pages, one SSR (
/ssr), the other simulating an admin page (/admin) protected by a middleware - A middleware example copied and pasted from the official Astro documentation to protect the admin page based on the path
Middleware-based protected route bypass - x-forwarded-proto only
The middleware has been configured to protect the /admin route based on the official documentation:
// src/middleware.ts
import { defineMiddleware } from "astro/middleware";
export const onRequest = defineMiddleware(async (context, next) => {
const isAuthed = false; // auth logic
if (context.url.pathname === "/admin" && !isAuthed) {
return context.redirect("/");
}
return next();
});
-
When tryint to access
/adminthe attacker is naturally redirected :curl -i http://localhost:4321/admin<img width="620" height="102" alt="image" src="https://github.com/user-attachments/assets/15a7bffc-ee56-4ed9-84b2-091cf4d78351" />
-
The attackr can bypass the middleware path check using a malicious header value:
curl -i -H "x-forwarded-proto: x:admin?" http://localhost:4321/admin
…
- Record
GHSA-hr2q-hp5q-x767- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - Weakness
- CWE-918
- Updated
- 2026-11-02
Show 11 moreShow less
OSVCLSA-2026-1778114666 No score
TuxCare security update for 5 packages (9 CVEs)
TuxCare rebuilt 5 packages to address 9 CVEs. Fixed in 4.16.19-tuxcare.1.
- Record
CLSA-2026-1778114666- Updated
- 2026-11-02
OSVCLSA-2026-1778633121 No score
TuxCare security update for astro (11 CVEs)
TuxCare rebuilt astro to address 11 CVEs. Fixed in 3.6.5-tuxcare.1.
- Record
CLSA-2026-1778633121- Updated
- 2026-11-02
OSVCLSA-2026-1792161545 No score
TuxCare security update for @astrojs/internal-helpers (10 CVEs)
TuxCare rebuilt @astrojs/internal-helpers to address 10 CVEs. Fixed in 4.16.19-tuxcare.1.
- Record
CLSA-2026-1792161545- Updated
- 2026-11-02
OSVCLSA-2026-1792161546 No score
TuxCare security update for @astrojs/internal-helpers (13 CVEs)
TuxCare rebuilt @astrojs/internal-helpers to address 13 CVEs. Fixed in 3.6.5-tuxcare.1.
- Record
CLSA-2026-1792161546- Updated
- 2026-11-02
OSVCLSA-2026-1792161684 No score
TuxCare security update for @astrojs/prism (10 CVEs)
TuxCare rebuilt @astrojs/prism to address 10 CVEs. Fixed in 4.16.19-tuxcare.1.
- Record
CLSA-2026-1792161684- Updated
- 2026-11-02
OSVCLSA-2026-1792161686 No score
TuxCare security update for @astrojs/prism (13 CVEs)
TuxCare rebuilt @astrojs/prism to address 13 CVEs. Fixed in 3.6.5-tuxcare.1.
- Record
CLSA-2026-1792161686- Updated
- 2026-11-02
OSVCLSA-2026-1792161759 No score
TuxCare security update for @astrojs/studio (10 CVEs)
TuxCare rebuilt @astrojs/studio to address 10 CVEs. Fixed in 4.16.19-tuxcare.1.
- Record
CLSA-2026-1792161759- Updated
- 2026-11-02
OSVCLSA-2026-1792161776 No score
TuxCare security update for @astrojs/underscore-redirects (10 CVEs)
TuxCare rebuilt @astrojs/underscore-redirects to address 10 CVEs. Fixed in 4.16.19-tuxcare.1.
- Record
CLSA-2026-1792161776- Updated
- 2026-11-02
OSVCLSA-2026-1792161777 No score
TuxCare security update for @astrojs/underscore-redirects (13 CVEs)
TuxCare rebuilt @astrojs/underscore-redirects to address 13 CVEs. Fixed in 3.6.5-tuxcare.1.
- Record
CLSA-2026-1792161777- Updated
- 2026-11-02
OSVCLSA-2026-1792161847 No score
TuxCare security update for @astrojs/upgrade (10 CVEs)
TuxCare rebuilt @astrojs/upgrade to address 10 CVEs. Fixed in 4.16.19-tuxcare.1.
- Record
CLSA-2026-1792161847- Updated
- 2026-11-02
OSVCLSA-2026-1792161848 No score
TuxCare security update for @astrojs/upgrade (13 CVEs)
TuxCare rebuilt @astrojs/upgrade to address 13 CVEs. Fixed in 3.6.5-tuxcare.1.
- Record
CLSA-2026-1792161848- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
astronpm |
2.16.0 up to 5.15.5 | 5.15.5 |
@astrojs/dbTuxCare:npm From an advisory covering 8 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
@astrojs/rssTuxCare:npm From an advisory covering 8 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
@astrojs/telemetryTuxCare:npm From an advisory covering 8 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
astroTuxCare:npm From an advisory covering 8 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
create-astroTuxCare:npm From an advisory covering 8 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
astroTuxCare:npm From an advisory covering 11 CVEs |
3.6.5-tuxcare.0 up to 3.6.5-tuxcare.1, plus listed versions 3.6.5 |
3.6.5-tuxcare.1 |
@astrojs/internal-helpersTuxCare:npm From an advisory covering 9 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
@astrojs/internal-helpersTuxCare:npm From an advisory covering 13 CVEs |
3.6.5-tuxcare.0 up to 3.6.5-tuxcare.1, plus listed versions 3.6.5 |
3.6.5-tuxcare.1 |
@astrojs/prismTuxCare:npm From an advisory covering 9 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
Show 6 moreShow less
| Package | Affected | Fixed |
|---|---|---|
@astrojs/prismTuxCare:npm From an advisory covering 13 CVEs |
3.6.5-tuxcare.0 up to 3.6.5-tuxcare.1, plus listed versions 3.6.5 |
3.6.5-tuxcare.1 |
@astrojs/studioTuxCare:npm From an advisory covering 9 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
@astrojs/underscore-redirectsTuxCare:npm From an advisory covering 9 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
@astrojs/underscore-redirectsTuxCare:npm From an advisory covering 13 CVEs |
3.6.5-tuxcare.0 up to 3.6.5-tuxcare.1, plus listed versions 3.6.5 |
3.6.5-tuxcare.1 |
@astrojs/upgradeTuxCare:npm From an advisory covering 9 CVEs |
4.16.19-tuxcare.0 up to 4.16.19-tuxcare.1, plus listed versions 4.16.19 |
4.16.19-tuxcare.1 |
@astrojs/upgradeTuxCare:npm From an advisory covering 13 CVEs |
3.6.5-tuxcare.0 up to 3.6.5-tuxcare.1, plus listed versions 3.6.5 |
3.6.5-tuxcare.1 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| Nuclei | Astro - Broken Access Control |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, Nuclei, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-64525 is a medium vulnerability (CVSS 6.5) in Astro, published November 13, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.24%, the 69th percentile. Fixed in astro 5.15.5.
References
github.com/withastro/astro/security/advisories/GHSA-hr2q-hp5q-x767
github.com/withastro/astro/commit/dafbb1ba29912099c4faff1440033edc768af8b4
github.com/withastro/astro/blob/970ac0f51172e1e6bff4440516a851e725ac3097/packages/astro/src/core/app/node.ts
nvd.nist.gov/vuln/detail/CVE-2025-64525
github.com/advisories/GHSA-hr2q-hp5q-x767
github.com/CVEProject/cvelistV5/tree/main/cves/2025/64xxx/CVE-2025-64525.json
github.com/withastro/astro
Left out here: the rest of 2 source descriptions. The JSON record has them.