{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2024-56140","id":"CVE-2024-56140","title":"Bypass of CSRF Middleware in Astro","description":"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 `Co","descriptionLong":"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.","published":"2024-12-18T20:41:06.806Z","updated":"2026-10-28T02:31:05.077126390Z","reserved":"2024-12-16T17:30:30.068Z","status":"Analyzed","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N","rating":"medium","source":"GitHub_M"},{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N","rating":"medium","source":"github.com"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","rating":"medium","source":"NVD"},{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N","rating":"medium","source":"OSV"},{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N","rating":"medium","source":"GitHub"}],"rating":"medium","products":["withastro astro"],"affectedProducts":[{"vendor":"withastro","product":"astro","defaultStatus":null,"versions":[{"version":"< 4.16.17","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"npm","name":"astro","purl":"pkg:npm/astro","ranges":["<4.16.17"],"fixed":["4.16.17"],"advisory":"GHSA-c4pw-33h3-35xw"}],"cwes":["CWE-352"],"aliases":["GHSA-c4pw-33h3-35xw"],"references":[{"url":"https://github.com/withastro/astro/security/advisories/GHSA-c4pw-33h3-35xw","tags":["x_refsource_CONFIRM","Vendor Advisory","advisory","web"]},{"url":"https://github.com/withastro/astro/commit/e7d14c374b9d45e27089994a4eb72186d05514de","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests","tags":["x_refsource_MISC","Technical Description","web"]},{"url":"https://github.com/withastro/astro/blob/6031962ab5f56457de986eb82bd24807e926ba1b/packages/astro/src/core/app/middlewares.ts","tags":["x_refsource_MISC","Product","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/56xxx/CVE-2024-56140.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-56140","tags":["advisory"]},{"url":"https://github.com/withastro/astro","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial"},"epss":0.00223,"epssPercentile":0.13043,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2024-56140","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-56140","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2024-56140","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-c4pw-33h3-35xw","ok":true,"note":"GHSA-c4pw-33h3-35xw"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2024-56140","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}