# CVE-2025-61925: Astro's `X-Forwarded-Host` is reflected with no validation

> Attackers can manipulate Astro.url via X-Forwarded-Host to redirect users to malicious sites, potentially stealing credentials if cached.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Oct 2025
- **Updated:** 10 Oct 2025
- **Also known as:** GHSA-5ff5-9fcw-vg88

## What is CVE-2025-61925?

CVE-2025-61925 is a medium-severity vulnerability in withastro astro, published on 10 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Astro is a web framework. Prior to version 5.14.2, Astro reflects the value in `X-Forwarded-Host` in output when using `Astro.url` without any validation. It is common for web servers such as nginx to route requests via the `Host` header, and forward on other request headers. As such as malicious request can be sent with both a `Host` header and an `X-Forwarded-Host` header where the values do not match and the `X-Forwarded-Host` header is malicious. Astro will then return the malicious value. This could result in any usages of the `Astro.url` value in code being manipulated by a request. For example if a user follows guidance and uses `Astro.url` for a canonical link the canonical link can be manipulated to another site. It is theoretically possible that the value could also be used as a login/registration or other form URL as well, resulting in potential redirecting of login credentials to a malicious party. As this is a per-request attack vector the surface area would only be to the malicious user until one considers that having a caching proxy is a common setup, in which case any page which is cached could persist the malicious value for subsequent users. Many other frameworks have an allowlist of domains to validate against, or do not have a case where the headers are reflected to avoid such issues. This could affect anyone using Astro in an on-demand/dynamic rendering mode behind a caching proxy. Version 5.14.2 contains a fix for the issue.

Weakness: CWE-470 (Use of Externally-Controlled Input to Select Classes or Code)

## Which versions are affected by CVE-2025-61925?

2 open source packages ship an affected version, including astro. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `astro` | npm | All versions | 5.14.3 |
| `astro` | npm | All versions | 5.14.3 |

Products: Astro Astro.

## How do I fix CVE-2025-61925?

Upgrade astro to 5.14.3 or later.

## Is CVE-2025-61925 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-61925 exists.

## Other vulnerabilities in withastro astro

- [CVE-2024-56159](https://insights.sbomify.com/CVE-2024-56159/): Server source code is exposed to the public if sourcemaps are enabled (high 7.8)
- [CVE-2026-54299](https://insights.sbomify.com/CVE-2026-54299/): Astro: Host header SSRF in prerendered error page fetch (high 7.5)
- [CVE-2025-59837](https://insights.sbomify.com/CVE-2025-59837/): astro allows bypass of image proxy domain validation leading to SSRF and potential XSS (high 7.2)
- [CVE-2026-50146](https://insights.sbomify.com/CVE-2026-50146/): Astro: Reflected XSS via unescaped slot name (high 7.1)
- [CVE-2025-64764](https://insights.sbomify.com/CVE-2025-64764/): Astro is vulnerable to Reflected XSS via the server islands feature (high 7.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-61925 and fix it if it is affected.

What it is: CVE-2025-61925 is a medium-severity vulnerability in withastro astro, published on 10 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-61925 exists.

Affected packages and fixed versions:
- astro (npm): affected all versions; fixed in 5.14.3
- astro (npm): affected all versions; fixed in 5.14.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-61925/ (Markdown: https://insights.sbomify.com/CVE-2025-61925/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-61925
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-61925
- OSV: https://osv.dev/vulnerability/CVE-2025-61925

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-61925/
Summaries are generated and may contain mistakes; the official description above is the record.
