{"id":"GHSA-whqg-ppgf-wp8c","summary":"Astro has an Authentication Bypass via Double URL Encoding, a bypass for CVE-2025-64765","details":"# Authentication Bypass via Double URL Encoding in Astro\n## Bypass for CVE-2025-64765 / GHSA-ggxq-hp9w-j794\n\n---\n\n### Summary\n\nA **double URL encoding bypass** allows any unauthenticated attacker to bypass path-based authentication checks in Astro middleware, granting unauthorized access to protected routes. While the original CVE-2025-64765 (single URL encoding) was fixed in v5.15.8, the fix is insufficient as it only decodes once. By using double-encoded URLs like `/%2561dmin` instead of `/%61dmin`, attackers can still bypass authentication and access protected resources such as `/admin`, `/api/internal`, or any route protected by middleware pathname checks.\n\n\n## Fix \n\nA more secure fix is just decoding once, then if the request has a %xx format, return a 400 error by using something like :\n\n```\nif (containsEncodedCharacters(pathname)) {\n            // Multi-level encoding detected - reject request\n            return new Response(\n                'Bad Request: Multi-level URL encoding is not allowed',\n                {\n                    status: 400,\n                    headers: { 'Content-Type': 'text/plain' }\n                }\n            );\n        }\n```","aliases":["CVE-2025-66202"],"modified":"2026-02-04T02:27:12.689316Z","published":"2025-12-08T16:26:43Z","related":["CVE-2025-66202"],"database_specific":{"github_reviewed":true,"nvd_published_at":"2025-12-09T00:15:48Z","cwe_ids":["CWE-647"],"severity":"MODERATE","github_reviewed_at":"2025-12-08T16:26:43Z"},"references":[{"type":"WEB","url":"https://github.com/withastro/astro/security/advisories/GHSA-ggxq-hp9w-j794"},{"type":"WEB","url":"https://github.com/withastro/astro/security/advisories/GHSA-whqg-ppgf-wp8c"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-64765"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66202"},{"type":"WEB","url":"https://github.com/withastro/astro/commit/6f800813516b07bbe12c666a92937525fddb58ce"},{"type":"PACKAGE","url":"https://github.com/withastro/astro"}],"affected":[{"package":{"name":"astro","ecosystem":"npm","purl":"pkg:npm/astro"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"5.15.8"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/12/GHSA-whqg-ppgf-wp8c/GHSA-whqg-ppgf-wp8c.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"}]}