{"answers":{"affected":"4 open source packages ship an affected version, including @nestjs/platform-fastify.","exploited":"There is no known exploitation of GHSA-9c5c-9qcx-q35q in the wild and no public exploit code.","fix":"Upgrade @nestjs/platform-fastify to a fixed version for your release line: 11.2.4 or 12.0.2.","what":"GHSA-9c5c-9qcx-q35q is an authentication bypass vulnerability in @nestjs/platform-fastify, published on 30 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-9c5c-9qcx-q35q and fix it if it is affected.\n\nWhat it is: GHSA-9c5c-9qcx-q35q is an authentication bypass vulnerability in @nestjs/platform-fastify, published on 30 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-9c5c-9qcx-q35q in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @nestjs/platform-fastify (npm): affected all versions; fixed in 11.2.4\n- @nestjs/platform-fastify (npm): affected all versions; fixed in 11.2.4\n- @nestjs/platform-fastify (npm): affected from 12.0.0; fixed in 12.0.2\n- @nestjs/platform-fastify (npm): affected from 12.0.0; fixed in 12.0.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-9c5c-9qcx-q35q/ (Markdown: https://insights.sbomify.com/GHSA-9c5c-9qcx-q35q/index.md)","id":"GHSA-9c5c-9qcx-q35q","markdown":"https://insights.sbomify.com/GHSA-9c5c-9qcx-q35q/index.md","name":"GHSA-9c5c-9qcx-q35q","record":{"aliases":[],"analysis":{"component_type":"server_software","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"NestJS Fastify adapter","requires_auth":"none","summary":"Attackers can bypass path-scoped authentication and authorization middleware in NestJS Fastify applications by sending absolute-form HTTP requests.","user_interaction":"not_required","vuln_class":"auth_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"| Field | Value |\n| --- | --- |\n| Ecosystem | npm |\n| Package | `@nestjs/platform-fastify` |\n| Affected versions | `\u003e= 12.0.0, \u003c 12.0.2` and `\u003c 11.2.4` |\n| Patched versions | `12.0.2` and `11.2.4` (upgrade to `12.0.3` / `11.2.5`) |\n\n### Summary\n\nOn the Fastify adapter, an HTTP request that uses an **absolute-form request target** (`GET http://host/path HTTP/1.1`\ninstead of `GET /path HTTP/1.1`) reaches the route handler without running the path-scoped Nest middleware bound to\nthat route. Applications that enforce authentication or authorization in middleware execute the protected handler\nwith those checks skipped.\n\n### Impact\n\nAny application that\n\n- uses `@nestjs/platform-fastify`, and\n- binds middleware to specific paths via `MiddlewareConsumer.forRoutes(...)` or `.exclude(...)`, and\n- is reachable by a client that controls the raw request line.\n\nNode's HTTP server accepts absolute-form targets, so no special server configuration is needed. Exposure is reduced\nwhen a reverse proxy in front of the application rewrites the request target to origin-form, which most do.\n\nWhere the bypassed middleware performs authentication or authorization, the result is an authentication or\nauthorization bypass. Where it performs logging, rate limiting or body handling, those are silently skipped instead.\n\n### Details\n\nFastify's router (`find-my-way`) resolves an absolute-form target to its path before matching, so the route handler\nis dispatched normally. Two places on the middleware side matched against the **raw** request target instead:\n\n1. The bundled copy of the `@fastify/middie` engine at `packages/platform-fastify/adapters/middie/fastify-middie.ts`.\n   NestJS carried this fork to apply an earlier path-decoding fix and it did not track the upstream absolute-form fix\n   released in `@fastify/middie@9.3.4`.\n2. `FastifyAdapter`'s own re-check in `createMiddlewareFactory()`, which tests the middleware path regexp against\n   `req.originalUrl`.\n\nBoth normalized and percent-decoded the target, but neither resolved absolute-form to a path, so the router and the\nmiddleware layer disagreed about which path was being requested.\n\nA second, related defect contributed. Because the adapter always passes `routerOptions` (to install the version\nconstraint), Fastify did not reflect the deprecated **top-level** router options (`ignoreTrailingSlash`,\n`ignoreDuplicateSlashes`, `caseSensitive`, `useSemicolonDelimiter`) in `initialConfig.routerOptions`, which is what\nthe middleware engine reads. Applications passing those options at the top level had middleware normalize paths\ndifferently from the router, which widened the mismatch.\n\n### Proof of concept\n\n```ts\n@Controller('users')\nexport class UsersController {\n  @Get()\n  findAll() {\n    return 'protected data';\n  }\n}\n\n@Module({ controllers: [UsersController] })\nexport class AppModule implements NestModule {\n  configure(consumer: MiddlewareConsumer) {\n    consumer\n      .apply((req, res) =\u003e res.end('blocked by auth middleware'))\n      .forRoutes({ path: 'users', method: RequestMethod.GET });\n  }\n}\n```\n\n`supertest` and `light-my-request` always emit origin-form targets, so the request has to be written to the socket:\n\n```js\nconst { connect } = require('node:net');\n\nconst socket = connect(3000, '127.0.0.1', () =\u003e {\n  socket.write(\n    'GET http://127.0.0.1:3000/users HTTP/1.1\\r\\n' +\n      'Host: 127.0.0.1:3000\\r\\n' +\n      'Connection: close\\r\\n\\r\\n',\n  );\n});\nsocket.pipe(process.stdout);\n```\n\nObserved on an affected version: `protected data` — the middleware did not run.\nExpected, and observed on a patched version: `blocked by auth middleware`.\n\n### Patches\n\nFixed in **12.0.2** and **11.2.4**. Upgrading to **12.0.3** or **11.2.5** is recommended.\n\n- The bundled `@fastify/middie` fork was removed and the package now depends on `@fastify/middie@9.3.4`, which\n  resolves absolute-form targets before matching.\n- The adapter resolves absolute-form targets in its own route check, mirroring `find-my-way`.\n- Deprecated top-level Fastify router options are folded into `routerOptions` so the middleware engine and the\n  router normalize paths identically.\n\n### Workarounds\n\nIf you cannot upgrade, reject non-origin-form request targets before middleware runs. Register the hook on the\nFastify instance **before the application is initialized**, so that it runs ahead of the middleware engine's own\n`onRequest` hook, and confirm with the request above that the rejection takes effect:\n\n```ts\nconst adapter = new FastifyAdapter();\nadapter.getInstance().addHook('onRequest', (request, reply, done) =\u003e {\n  const target = request.raw.url ?? '';\n  // \"*\" is the legitimate request target of \"OPTIONS * HTTP/1.1\"\n  if (target[0] !== '/' \u0026\u0026 target !== '*') {\n    reply.code(400).send();\n    return;\n  }\n  done();\n});\n```\n\nRejecting or normalizing absolute-form targets at a reverse proxy in front of the application is equally effective.\n\n### Credit\n\nReported by ZeroVuln Labs.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"@nestjs/platform-fastify: Path-scoped middleware bypass via absolute-form request targets","id":"GHSA-9c5c-9qcx-q35q","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"auth_bypass","year":"2026"},"n_packages":4,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["11.2.4"],"introduced":["0"],"last_affected":[],"package":"@nestjs/platform-fastify","purl":null,"source":"GHSA-9c5c-9qcx-q35q"},{"ecosystem":"npm","fixed":["11.2.4"],"introduced":["0"],"last_affected":[],"package":"@nestjs/platform-fastify","purl":"pkg:npm/%40nestjs/platform-fastify","source":"GHSA-9c5c-9qcx-q35q"},{"ecosystem":"npm","fixed":["12.0.2"],"introduced":["12.0.0"],"last_affected":[],"package":"@nestjs/platform-fastify","purl":null,"source":"GHSA-9c5c-9qcx-q35q"},{"ecosystem":"npm","fixed":["12.0.2"],"introduced":["12.0.0"],"last_affected":[],"package":"@nestjs/platform-fastify","purl":"pkg:npm/%40nestjs/platform-fastify","source":"GHSA-9c5c-9qcx-q35q"}],"products":null,"published":"2026-09-30","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can bypass path-scoped authentication and authorization middleware in NestJS Fastify applications by sending absolute-form HTTP requests.","url":"https://insights.sbomify.com/GHSA-9c5c-9qcx-q35q/"}