Bypass of CSRF Middleware in Astro
CVE-2024-56140Published 18 Dec 2024, 20:41 UTC
Real-world risk
2.1/ 10Low
Routine
PreliminaryFrom the CVSS vector only · confidence low
CVSS
5.9
scored by the vendor (CNA), CVSS 3.1
In plain words
No plain-language summary yet. The original description is below.
Original description (from GitHub_M)
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.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| astroCommon | < 4.16.17 | 4.16.17 |
What to do
Update to a fixed version: 4.16.17.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | Major data tamperingWrites or changes important data without gaining execution | From the CVSS vector | 0.70 |
| Attacker position | InternetAnyone on the Internet can reach a typical deployment | From the CVSS vector | 1.00 |
| Privileges needed | NoneNo account | From the CVSS vector | 1.00 |
| Victim interaction | RoutineA normal action: open a file, visit a page, click a link | From the CVSS vector | 0.70 |
| Configuration | DefaultOut-of-the-box installs are vulnerable | From the CVSS vector | 1.00 |
| Reliability | HardNarrow race, needs an extra info leak, needs a man-in-the-middle position, or must be chained with another bug | From the CVSS vector | 0.45 |
Threat level T3: Public proof of concept (× 0.95)
A qualifying GitHub proof of concept, an unverified Exploit-DB entry, CISA's SSVC says PoC, or a reference tagged as an exploit
- CISA SSVC: proof of concept
EPSS 0.2% chance of exploitation in 30 days (percentile 16), as of 2026-12-05.
The arithmetic
- Prerequisites multiplied together0.315
- Threat T3: Public proof of concept0.950
- 10 × impact 0.7 × prerequisites 0.315 × threat 0.952.095
- Rounded to one decimal between 0.1 and 102.1
Exploitation and evidence timeline
- 18 Dec 2024 Published
- 3 Dec 2026 CISA SSVC: proof of concept first seen
- 3 Dec 2026 Risk 2.1 (cvss fallback)
Weakness
CWE-352
References
- https://github.com/withastro/astro/security/advisories/GHSA-c4pw-33h3-35xwvendor-advisory
- https://github.com/withastro/astro/commit/e7d14c374b9d45e27089994a4eb72186d05514demisc
- https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requestsmisc
- https://github.com/withastro/astro/blob/6031962ab5f56457de986eb82bd24807e926ba1b/packages/astro/src/core/app/middlewares.tsmisc
- CVE-2024-56140 on CVE.org