Executive brief
Astro is a modern web framework used to build and deploy websites and applications. When a server-side rendered page encounters an error and displays a custom error page (like a 404 or 500 error), an attacker can manipulate the Host header to trick the application into fetching content from the attacker's server and then following a redirect to read sensitive data from internal services. This allows attackers to access metadata services, internal databases, or other resources that should only be accessible within the organization's network.
Technical details
The vulnerability is a Server-Side Request Forgery (SSRF) in the error rendering logic of Astro's Node.js adapter. The vulnerable code in base.ts (line 534) fetches a prerendered error page (e.g., /500.html) using the Host header value without proper validation, and follows HTTP redirects. An attacker can set the Host header to point to their own server (e.g., "attacker.tld"), causing Astro to fetch http://attacker.tld/500.html. The attacker's server can then respond with a redirect to any internal URL (e.g., http://localhost:8000/ssrf.txt or cloud metadata endpoints), and the response body is returned to the client. The vulnerability requires direct network access to the application (bypassing any proxy that validates the Host header) and affects only server-side rendered pages with custom prerendered error pages. The patch is available in version 9.5.4 and later of @astrojs/node.
Affected products
- Astro @astrojs/node before 9.5.4
Timeline
- 2026-02-23: disclosed
- 2026-02-23: patched: Fix available in @astrojs/node 9.5.4