Bypass of CSRF Middleware in Astro
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Tampering
- Confidentiality · integrity · availability
- None · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-352.
Summary
Astro is a web framework for content-driven websites. In affected versions a bug in Astro’s CSRF-protection middleware allows requests to bypass CSRF checks. When the `security.checkOrigin` configuration option is set to `true`, Astro middleware will perform a CSRF check. However, a vulnerability exists that can bypass this security. A semicolon-delimited parameter is allowed after the type in `Content-Type`. Web browsers will treat a `Content-Type` such as `application/x-www-form-urlencoded; abc` as a `simple request` and will not perform preflight validation. In this case, CSRF is not blocked as expected. Additionally, the `Content-Type` header is not required for a request. This issue has been addressed in version 4.16.17 and all users are advised to upgrade. There are no known workarounds for this vulnerability.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| withastro | astro | before 4.16.17 | 4.16.17 | Patch available | CNA |
| — | astro (npm) | before 4.16.17 | 4.16.17 | Patch available | GHSA-c4pw-33h3-35xw |
- astro Vendorwithastro Affected before 4.16.17 Fixed in 4.16.17 Patch available CNA
- astro (npm) Vendor— Affected before 4.16.17 Fixed in 4.16.17 Patch available GHSA-c4pw-33h3-35xw
Remediation
- Fix · CNA astro (withastro) Fixed in 4.16.17
- Fix · GHSA-c4pw-33h3-35xw astro (npm) Fixed in 4.16.17 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-56140
- 2026-10-03 Alias added: GHSA-c4pw-33h3-35xw
References
Advisory 2
More withastro Astro vulnerabilities
- TI-2024-37142 Server source code is exposed to the public if sourcemaps are enabled CVSS 4.0HIGH 7.8
- TI-2025-34958 Unauthorized third-party images in Astro’s _image endpoint CVSS 4.0MEDIUM 6.9
- TI-2025-39915 Server-side request forgery in withastro astro CVSS 3.1MEDIUM 6.5
- TI-2025-38274 Astro's `X-Forwarded-Host` is reflected with no validation CVSS 3.1MEDIUM 6.5
- TI-2026-36915 Astro: Reflected XSS via unescaped slot name CVSS 3.1HIGH 7.1
- TI-2025-40102 Astro is vulnerable to Reflected XSS via the server islands feature CVSS 3.1HIGH 7.1
Sources
- CVE-2024-56140 · CVE Program
- CVE-2024-56140 · NVD
- FIRST EPSS
- GHSA-c4pw-33h3-35xw · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences