{"id":"CVE-2026-76169","aliases":["CVE-2026-76169","GHSA-p68q-wchp-6fh7"],"related":[],"kind":"vulnerability","state":"published","title":"fastify vulnerable to authentication bypass via malformed URLs reaching encapsulated not-found handlers","summary":"fastify versions >= 4.0.0 and before 5.12.2 can route a malformed URL sent under one plugin prefix to the custom not-found handler of a different sibling plugin, and invoke it without the preHandler hook declared for that handler. The internal not-found router for encapsulated handlers dispatches malformed paths through a single shared handler pointer before URL decoding, ignoring the prefix and skipping the selected handler's normal lifecycle. An unauthenticated attacker can therefore reach an authentication-protected private fallback through an unrelated public prefix and read its full response, bypassing the authentication hook and breaking prefix encapsulation. Users should upgrade to fastify 5.12.2 or later.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"fastify versions >= 4.0.0 and before 5.12.2 can route a malformed URL sent under one plugin prefix to the custom not-found handler of a different sibling plugin, and invoke it without the preHandler hook declared for that handler. The internal not-found router for encapsulated handlers dispatches malformed paths through a single shared handler pointer before URL decoding, ignoring the prefix and skipping the selected handler's normal lifecycle. An unauthenticated attacker can therefore reach an authentication-protected private fallback through an unrelated public prefix and read its full response, bypassing the authentication hook and breaking prefix encapsulation. Users should upgrade to fastify 5.12.2 or later.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nFastify routes a malformed URL under one plugin prefix to the custom not-found handler of a different sibling plugin, invoking the handler registered last and skipping the `preHandler` declared in its `setNotFoundHandler()`. When the request method has no route in the main router, a malformed request target reaches Fastify's internal not-found router before URL decoding and is dispatched through a single shared handler pointer, regardless of prefix and without the normal request lifecycle. An unauthenticated request to a public prefix can therefore reach an authentication-protected not-found handler registered under a different prefix and receive its full response, breaking prefix encapsulation and bypassing the authentication hook. Applications whose private or tenant fallbacks return protected data from a not-found handler are affected.\n\n### Patches\n\nPatched in fastify 5.12.2. Malformed URLs are now routed through the configured `onBadUrl` and `onMaxParamLength` handlers so they fail closed before any application not-found handler runs, and the shared not-found handler pointer has been removed.\n\n### Workarounds\n\nReject malformed request targets before they reach the application, for example at an upstream proxy or gateway, and do not rely on a not-found handler to serve protected data. A global `onRequest` authentication hook does not mitigate this, because the malformed-URL path skips it.","format":"markdown","source":"ghsa"}],"published":"2026-09-04T09:51:03.556Z","modified":"2026-10-01T00:00:05.665Z","severity":{"scorer":"openjs","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"openjs","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-288"],"affected":[{"ranges":[{"type":"semver","introduced":"4.0.0","fixed":"5.12.2","status":"affected"},{"type":"semver","version":"5.12.2","status":"unaffected"}],"vendor":"fastify","product":"fastify","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"5.12.2"}],"ecosystem":"npm","package":"fastify","purl":"pkg:npm/fastify","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"4.0.0","fixed":"5.12.2"}],"vendor":"fastify","product":"fastify","cpe":"cpe:2.3:a:fastify:fastify:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/fastify/fastify/security/advisories/GHSA-p68q-wchp-6fh7","tags":["mitigation","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://cna.openjsf.org/security-advisories.html","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-76169","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/fastify/fastify/commit/93c239a380f3f2778bb7565fcdf777e91cfe1fbc","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/fastify/fastify","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/fastify/fastify/releases/tag/v5.12.2","tags":["web"],"sources":["ghsa"]}],"credits":["vvvvvvvvvvitel","mcollina","UlisesGascon","schecthellraiser606","B1gN0Se"],"assigner":"openjs","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-09-04T16:18:32.577Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-76169","url":"https://www.cve.org/CVERecord?id=CVE-2026-76169","licence":"CVE Terms of Use","modified":"2026-09-04T16:20:02.318Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p68q-wchp-6fh7","url":"https://github.com/advisories/GHSA-p68q-wchp-6fh7","licence":"CC-BY-4.0","modified":"2026-10-01T00:00:05.665Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-76169","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-76169","licence":"Public domain","modified":"2026-09-15T20:07:46.700Z"}],"updatedAt":"2026-11-25T22:59:36.268Z","epss":{"score":0.0041,"percentile":0.37299,"date":"2026-12-01T12:00:22.000Z"}}