{"id":"CVE-2024-56140","aliases":["CLSA-2026-1777855417","CLSA-2026-1777855422","CLSA-2026-1777941830","CLSA-2026-1778633121","CLSA-2026-1792161544","CLSA-2026-1792161546","CLSA-2026-1792161681","CLSA-2026-1792161682","CLSA-2026-1792161683","CLSA-2026-1792161686","CLSA-2026-1792161775","CLSA-2026-1792161777","CLSA-2026-1792161848","EUVD-2024-3575","GHSA-c4pw-33h3-35xw"],"status":"published","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 `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.","severity":{"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","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00223,"percentile":0.12993,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-352"],"published":"2024-12-18T15:02:37Z","modified":"2026-10-30T19:45:58Z","fixes":[{"ecosystem":"npm","package":"astro","fixed_in":["4.16.17"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"astro","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.16.17"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"astro","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.9.2-tuxcare.0"},{"fixed":"1.9.2-tuxcare.1"}]}],"versions":["1.9.2"],"bundled":10},{"source":"osv","ecosystem":"TuxCare:npm","package":"astro","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.26.1-tuxcare.0"},{"fixed":"0.26.1-tuxcare.1"}]}],"versions":["0.26.1"],"bundled":10},{"source":"osv","ecosystem":"TuxCare:npm","package":"astro","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.10.15-tuxcare.0"},{"fixed":"2.10.15-tuxcare.1"}]}],"versions":["2.10.15"],"bundled":10},{"source":"osv","ecosystem":"TuxCare:npm","package":"astro","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.6.5-tuxcare.0"},{"fixed":"3.6.5-tuxcare.1"}]}],"versions":["3.6.5"],"bundled":11},{"source":"osv","ecosystem":"TuxCare:npm","package":"@astrojs/internal-helpers","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.10.15-tuxcare.0"},{"fixed":"2.10.15-tuxcare.1"}]}],"versions":["2.10.15"],"bundled":11},{"source":"osv","ecosystem":"TuxCare:npm","package":"@astrojs/internal-helpers","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.6.5-tuxcare.0"},{"fixed":"3.6.5-tuxcare.1"}]}],"versions":["3.6.5"],"bundled":13},{"source":"osv","ecosystem":"TuxCare:npm","package":"@astrojs/prism","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.9.2-tuxcare.0"},{"fixed":"1.9.2-tuxcare.1"}]}],"versions":["1.9.2"],"bundled":10},{"source":"osv","ecosystem":"TuxCare:npm","package":"@astrojs/prism","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.26.1-tuxcare.0"},{"fixed":"0.26.1-tuxcare.1"}]}],"versions":["0.26.1"],"bundled":10},{"source":"osv","ecosystem":"TuxCare:npm","package":"@astrojs/prism","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.10.15-tuxcare.0"},{"fixed":"2.10.15-tuxcare.1"}]}],"versions":["2.10.15"],"bundled":11},{"source":"osv","ecosystem":"TuxCare:npm","package":"@astrojs/prism","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.6.5-tuxcare.0"},{"fixed":"3.6.5-tuxcare.1"}]}],"versions":["3.6.5"],"bundled":13},{"source":"osv","ecosystem":"TuxCare:npm","package":"@astrojs/underscore-redirects","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.10.15-tuxcare.0"},{"fixed":"2.10.15-tuxcare.1"}]}],"versions":["2.10.15"],"bundled":11},{"source":"osv","ecosystem":"TuxCare:npm","package":"@astrojs/underscore-redirects","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.6.5-tuxcare.0"},{"fixed":"3.6.5-tuxcare.1"}]}],"versions":["3.6.5"],"bundled":13},{"source":"osv","ecosystem":"TuxCare:npm","package":"@astrojs/upgrade","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.6.5-tuxcare.0"},{"fixed":"3.6.5-tuxcare.1"}]}],"versions":["3.6.5"],"bundled":13},{"source":"osv","ecosystem":"npm","package":"astro","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.16.17"}]}]}],"products":[{"vendor":"astro","product":"astro"},{"vendor":"withastro","product":"astro"}],"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://nvd.nist.gov/vuln/detail/CVE-2024-56140","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-c4pw-33h3-35xw"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/56xxx/CVE-2024-56140.json","tags":["advisory"]},{"url":"https://github.com/withastro/astro","tags":["package"]}],"sources":{"cve":[{"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 `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.","status":"published","published":"2024-12-18T20:41:06.806Z","modified":"2024-12-18T21:03:36.201Z","cvss":[{"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","level":"medium","assessor":"cna"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T14:33:57.638551Z"}],"euvd":[{"id":"EUVD-2024-3575","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 `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.","status":"published","published":"2024-12-18T20:41:06Z","modified":"2024-12-18T21:03:36Z","cvss":[{"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","level":"medium"}],"updated_at":"2026-11-03T00:04:34.09119Z"}],"ghsa":[{"id":"GHSA-c4pw-33h3-35xw","title":"Atro CSRF Middleware Bypass (security.checkOrigin)","description":"### Summary\n\nA bug in Astro’s CSRF-protection middleware allows requests to bypass CSRF checks.\n\n### Details\n\nWhen the `security.checkOrigin` configuration option is set to `true`, Astro middleware will perform a CSRF check. (Source code: https://github.com/withastro/astro/blob/6031962ab5f56457de986eb82bd24807e926ba1b/packages/astro/src/core/app/middlewares.ts)\n\nFor example, with the following Astro configuration:\n\n```js\n// astro.config.mjs\nimport { defineConfig } from 'astro/config';\nimport node from '@astrojs/node';\n\nexport default defineConfig({\n\toutput: 'server',\n\tsecurity: { checkOrigin: true },\n\tadapter: node({ mode: 'standalone' }),\n});\n```\n\nA request like the following would be blocked if made from a different origin:\n\n```js\n// fetch API or \u003cform action=\"https://test.example.com/\" method=\"POST\"\u003e\nfetch('https://test.example.com/', {\n\tmethod: 'POST',\n\tcredentials: 'include',\n\tbody: 'a=b',\n\theaders: { 'Content-Type': 'application/x-www-form-urlencoded' },\n});\n// =\u003e Cross-site POST form submissions are forbidden\n```\n\nHowever, a vulnerability exists that can bypass this security.\n\n#### Pattern 1: Requests with a semicolon after the `Content-Type`\n\nA semicolon-delimited parameter is allowed after the type in `Content-Type`.\n\nWeb browsers will treat a `Content-Type` such as `application/x-www-form-urlencoded; abc` as a [simple request](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests) and will not perform preflight validation. In this case, CSRF is not blocked as expected.\n\n```js\nfetch('https://test.example.com', {\n\tmethod: 'POST',\n\tcredentials: 'include',\n\tbody: 'test',\n\theaders: { 'Content-Type': 'application/x-www-form-urlencoded; abc' },\n});\n// =\u003e Server-side functions are executed (Response Code 200).\n```\n\n#### Pattern 2: Request without `Content-Type` header\n\nThe `Content-Type` header is not required for a request. The following examples are sent without a `Content-Type` header, resulting in CSRF.\n\n```js\n// Pattern 2.1 Request without body\nfetch('http://test.example.com', { method: 'POST', credentials: 'include' });\n\n// Pattern 2.2 Blob object without type\nfetch('https://test.example.com', {\n\tmethod: 'POST',\n\tcredentials: 'include',\n\tbody: new Blob(['a=b'], {}),\n});\n```\n\n### Impact\n\nBypass CSRF protection implemented with CSRF middleware.\n\n\u003e [!Note]\n\u003e Even with `credentials: 'include'`, browsers may not send cookies due to third-party cookie blocking. This feature depends on the browser version and settings, and is for privacy protection, not as a CSRF measure.","status":"published","published":"2024-12-18T15:02:37Z","modified":"2025-11-27T08:01:15Z","cvss":[{"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","level":"medium"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T14:39:10.178331Z"}],"nvd":[{"id":"CVE-2024-56140","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 `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.","status":"published","published":"2024-12-18T21:15:08.353Z","modified":"2026-06-17T08:11:45.22Z","cvss":[{"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","level":"medium","assessor":"secondary"},{"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","level":"medium","assessor":"primary"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T14:10:40.507978Z"}],"osv":[{"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 `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.","status":"published","published":"2024-12-18T20:41:06.806Z","modified":"2026-10-28T02:31:05.07712639Z","cvss":[{"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","level":"medium"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T15:44:44.777182Z"},{"id":"GHSA-c4pw-33h3-35xw","title":"Atro CSRF Middleware Bypass (security.checkOrigin)","description":"### Summary\n\nA bug in Astro’s CSRF-protection middleware allows requests to bypass CSRF checks.\n\n### Details\n\nWhen the `security.checkOrigin` configuration option is set to `true`, Astro middleware will perform a CSRF check. (Source code: https://github.com/withastro/astro/blob/6031962ab5f56457de986eb82bd24807e926ba1b/packages/astro/src/core/app/middlewares.ts)\n\nFor example, with the following Astro configuration:\n\n```js\n// astro.config.mjs\nimport { defineConfig } from 'astro/config';\nimport node from '@astrojs/node';\n\nexport default defineConfig({\n\toutput: 'server',\n\tsecurity: { checkOrigin: true },\n\tadapter: node({ mode: 'standalone' }),\n});\n```\n\nA request like the following would be blocked if made from a different origin:\n\n```js\n// fetch API or \u003cform action=\"https://test.example.com/\" method=\"POST\"\u003e\nfetch('https://test.example.com/', {\n\tmethod: 'POST',\n\tcredentials: 'include',\n\tbody: 'a=b',\n\theaders: { 'Content-Type': 'application/x-www-form-urlencoded' },\n});\n// =\u003e Cross-site POST form submissions are forbidden\n```\n\nHowever, a vulnerability exists that can bypass this security.\n\n#### Pattern 1: Requests with a semicolon after the `Content-Type`\n\nA semicolon-delimited parameter is allowed after the type in `Content-Type`.\n\nWeb browsers will treat a `Content-Type` such as `application/x-www-form-urlencoded; abc` as a [simple request](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests) and will not perform preflight validation. In this case, CSRF is not blocked as expected.\n\n```js\nfetch('https://test.example.com', {\n\tmethod: 'POST',\n\tcredentials: 'include',\n\tbody: 'test',\n\theaders: { 'Content-Type': 'application/x-www-form-urlencoded; abc' },\n});\n// =\u003e Server-side functions are executed (Response Code 200).\n```\n\n#### Pattern 2: Request without `Content-Type` header\n\nThe `Content-Type` header is not required for a request. The following examples are sent without a `Content-Type` header, resulting in CSRF.\n\n```js\n// Pattern 2.1 Request without body\nfetch('http://test.example.com', { method: 'POST', credentials: 'include' });\n\n// Pattern 2.2 Blob object without type\nfetch('https://test.example.com', {\n\tmethod: 'POST',\n\tcredentials: 'include',\n\tbody: new Blob(['a=b'], {}),\n});\n```\n\n### Impact\n\nBypass CSRF protection implemented with CSRF middleware.\n\n\u003e [!Note]\n\u003e Even with `credentials: 'include'`, browsers may not send cookies due to third-party cookie blocking. This feature depends on the browser version and settings, and is for privacy protection, not as a CSRF measure.","status":"published","published":"2024-12-18T15:02:37Z","modified":"2025-11-27T08:18:05.038082Z","cvss":[{"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","level":"medium"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T15:46:44.571161Z"},{"id":"CLSA-2026-1777855417","title":"TuxCare security update for astro (10 CVEs)","description":"TuxCare rebuilt astro to address 10 CVEs. Fixed in 1.9.2-tuxcare.1.","status":"published","published":"2026-08-04T14:52:30Z","modified":"2026-10-30T19:45:54.337273141Z","updated_at":"2026-11-02T15:43:44.384419Z"},{"id":"CLSA-2026-1777855422","title":"TuxCare security update for astro (10 CVEs)","description":"TuxCare rebuilt astro to address 10 CVEs. Fixed in 0.26.1-tuxcare.1.","status":"published","published":"2026-08-04T14:52:30Z","modified":"2026-10-30T19:45:52.829936878Z","updated_at":"2026-11-02T15:43:44.384419Z"},{"id":"CLSA-2026-1777941830","title":"TuxCare security update for astro (10 CVEs)","description":"TuxCare rebuilt astro to address 10 CVEs. Fixed in 2.10.15-tuxcare.1.","status":"published","published":"2026-08-04T14:52:30Z","modified":"2026-10-30T19:45:54.887902642Z","updated_at":"2026-11-02T15:43:44.737408Z"},{"id":"CLSA-2026-1778633121","title":"TuxCare security update for astro (11 CVEs)","description":"TuxCare rebuilt astro to address 11 CVEs. Fixed in 3.6.5-tuxcare.1.","status":"published","published":"2026-08-04T14:52:31Z","modified":"2026-10-30T19:45:58.685288003Z","updated_at":"2026-11-02T15:43:44.737408Z"},{"id":"CLSA-2026-1792161544","title":"TuxCare security update for @astrojs/internal-helpers (11 CVEs)","description":"TuxCare rebuilt @astrojs/internal-helpers to address 11 CVEs. Fixed in 2.10.15-tuxcare.1.","status":"published","published":"2026-10-16T14:39:04Z","modified":"2026-10-16T16:30:31.972857815Z","updated_at":"2026-11-02T15:43:51.213191Z"},{"id":"CLSA-2026-1792161546","title":"TuxCare security update for @astrojs/internal-helpers (13 CVEs)","description":"TuxCare rebuilt @astrojs/internal-helpers to address 13 CVEs. Fixed in 3.6.5-tuxcare.1.","status":"published","published":"2026-10-16T14:39:06Z","modified":"2026-10-16T16:30:31.968641871Z","updated_at":"2026-11-02T15:43:51.213191Z"},{"id":"CLSA-2026-1792161681","title":"TuxCare security update for @astrojs/prism (10 CVEs)","description":"TuxCare rebuilt @astrojs/prism to address 10 CVEs. Fixed in 1.9.2-tuxcare.1.","status":"published","published":"2026-10-16T14:41:21Z","modified":"2026-10-16T16:31:07.064396448Z","updated_at":"2026-11-02T15:43:51.213191Z"},{"id":"CLSA-2026-1792161682","title":"TuxCare security update for @astrojs/prism (10 CVEs)","description":"TuxCare rebuilt @astrojs/prism to address 10 CVEs. Fixed in 0.26.1-tuxcare.1.","status":"published","published":"2026-10-16T14:41:22Z","modified":"2026-10-16T16:31:07.119893696Z","updated_at":"2026-11-02T15:43:51.213191Z"},{"id":"CLSA-2026-1792161683","title":"TuxCare security update for @astrojs/prism (11 CVEs)","description":"TuxCare rebuilt @astrojs/prism to address 11 CVEs. Fixed in 2.10.15-tuxcare.1.","status":"published","published":"2026-10-16T14:41:23Z","modified":"2026-10-16T16:31:07.771808672Z","updated_at":"2026-11-02T15:43:51.213191Z"},{"id":"CLSA-2026-1792161686","title":"TuxCare security update for @astrojs/prism (13 CVEs)","description":"TuxCare rebuilt @astrojs/prism to address 13 CVEs. Fixed in 3.6.5-tuxcare.1.","status":"published","published":"2026-10-16T14:41:26Z","modified":"2026-10-16T16:31:14.45884769Z","updated_at":"2026-11-02T15:43:51.213191Z"},{"id":"CLSA-2026-1792161775","title":"TuxCare security update for @astrojs/underscore-redirects (11 CVEs)","description":"TuxCare rebuilt @astrojs/underscore-redirects to address 11 CVEs. Fixed in 2.10.15-tuxcare.1.","status":"published","published":"2026-10-16T14:42:55Z","modified":"2026-10-16T16:31:29.981829057Z","updated_at":"2026-11-02T15:43:51.213191Z"},{"id":"CLSA-2026-1792161777","title":"TuxCare security update for @astrojs/underscore-redirects (13 CVEs)","description":"TuxCare rebuilt @astrojs/underscore-redirects to address 13 CVEs. Fixed in 3.6.5-tuxcare.1.","status":"published","published":"2026-10-16T14:42:57Z","modified":"2026-10-16T16:31:09.691814468Z","updated_at":"2026-11-02T15:43:51.213191Z"},{"id":"CLSA-2026-1792161848","title":"TuxCare security update for @astrojs/upgrade (13 CVEs)","description":"TuxCare rebuilt @astrojs/upgrade to address 13 CVEs. Fixed in 3.6.5-tuxcare.1.","status":"published","published":"2026-10-16T14:44:08Z","modified":"2026-10-16T16:31:17.844824171Z","updated_at":"2026-11-02T15:43:51.213191Z"}]}}
