{"id":"CVE-2024-56140","published":"2024-12-18T20:41:06Z","modified":"2024-12-18T21:03:36Z","title":"Bypass of CSRF Middleware in Astro","vendor":"withastro","product":"astro","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.9,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00223,"percentile":0.13155,"provenance":"source"},"cwes":[{"id":"CWE-352","name":"Cross-Site Request Forgery"}],"references":[{"url":"https://github.com/withastro/astro/security/advisories/GHSA-c4pw-33h3-35xw","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/withastro/astro/commit/e7d14c374b9d45e27089994a4eb72186d05514de","tags":["x_refsource_MISC"]},{"url":"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests","tags":["x_refsource_MISC"]},{"url":"https://github.com/withastro/astro/blob/6031962ab5f56457de986eb82bd24807e926ba1b/packages/astro/src/core/app/middlewares.ts","tags":["x_refsource_MISC"]}],"priority":{"score":6.8,"factors":[{"name":"EPSS percentile","points":2.63},{"name":"CVSS severity","points":4.13}]},"vendorSlug":"withastro","affectedVersions":[{"vendor":"withastro","product":"astro","versions":["< 4.16.17"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2024-12-18T21:03:26.338528Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"astro","vulnerableRanges":["<4.16.17"],"patched":["4.16.17"],"from":["GHSA-c4pw-33h3-35xw"],"provenance":"source"}],"summary":{"text":"Astro's CSRF-protection middleware, used when security.checkOrigin is set to true, fails to block certain cross-site requests because it does not account for a semicolon-delimited parameter appended to the Content-Type value, which lets requests evade the origin check. An attacker can exploit this by getting a victim's browser to send a crafted cross-site request, which requires the victim to interact with a malicious page while the target application is in use.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:15:59Z"},"euvd":{"id":"EUVD-2024-3575","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-withastro-astro-cve-2024-56140","children":[{"from":"CVE-2024-56140","to":"CVE-2026-73423","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["packages/astro/src/core/app/middlewares.ts"],"commits":["https://github.com/withastro/astro/commit/e7d14c374b9d45e27089994a4eb72186d05514de","https://github.com/withastro/astro/commit/0b30b35f864310bee8485c952d1877e82e2b9b1a"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2024-47885","published":"2024-10-14","fixed":"4.16.1","kev":false,"link":{"from":"CVE-2024-47885","to":"CVE-2024-56140","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:astro","fromFixed":"4.16.1","toFixed":"4.16.17","daysApart":65}]}},{"cve":"CVE-2024-56140","published":"2024-12-18","fixed":"4.16.17","kev":false},{"cve":"CVE-2024-56159","published":"2024-12-19","fixed":"5.0.8","kev":false,"link":{"from":"CVE-2024-56140","to":"CVE-2024-56159","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:astro","fromFixed":"4.16.17","toFixed":"4.16.18","daysApart":1}]}},{"cve":"CVE-2025-54793","published":"2025-08-08","fixed":"5.12.8","kev":false},{"cve":"CVE-2025-55303","published":"2025-08-19","fixed":"5.13.2","kev":false}],"package":"npm:astro"}}