{"id":"GHSA-8wpr-639p-ccrj","revision":"79340ce85a0d448ca51c1544ff124bdc","records":[{"revision":"79340ce85a0d448ca51c1544ff124bdc","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-8wpr-639p-ccrj","aliases":["CVE-2025-69211"],"title":"Nest has a Fastify URL Encoding Middleware Bypass (TOCTOU)","description":"A NestJS application is vulnerable if it meets all of the following criteria:\n\n1. Platform: Uses `@nestjs/platform-fastify`.\n2. Security Mechanism: Relies on `NestMiddleware` (via `MiddlewareConsumer`) for security checks (authentication, authorization, etc.), or through `app.use()`\n3. Routing: Applies middleware to specific routes using string paths or controllers (e.g., `.forRoutes('admin')`).\nExample Vulnerable Config:\n\n```ts\n// app.module.ts\nexport class AppModule implements NestModule {\n  configure(consumer: MiddlewareConsumer) {\n    consumer\n      .apply(AuthMiddleware) // Security check\n      .forRoutes('admin');   // Vulnerable: Path-based restriction\n  }\n}\n```\n\nAttack Vector:\n\n- Target Route: `/admin`\n- Middleware Path: `admin`\n- Attack Request: `GET /%61dmin`\n- Result: Middleware is skipped (no match on `%61dmin`), but controller for `/admin` is executed.\n\nConsequences:\n\n- Authentication Bypass: Unauthenticated users can access protected routes.\n- Authorization Bypass: Restricted administrative endpoints become accessible to lower-privileged users.\n- Input Validation Bypass: Middleware performing sanitization or validation can be skipped.\n\n### Patches\n\nPatched in `@nestjs/platform-fastify@11.1.11`\n\n### Resources\n\nCredit goes to Hacktron AI for reporting this issue.","state":0,"publishedAt":"2025-12-30T15:32:44+00:00","modifiedAt":"2025-12-30T15:42:33.016579+00:00","affected":[{"ecosystem":"npm","name":"@nestjs/platform-fastify","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"11.1.11"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:U","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/nestjs/nest/security/advisories/GHSA-8wpr-639p-ccrj","https://nvd.nist.gov/vuln/detail/CVE-2025-69211","https://github.com/nestjs/nest/commit/c4cedda15a05aafec1e6045b36b0335ab850e771","https://github.com/nestjs/nest"],"sourceUrl":"https://github.com/advisories/GHSA-8wpr-639p-ccrj","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-8wpr-639p-ccrj","identifiers":["GHSA-8wpr-639p-ccrj","CVE-2025-69211"]},"retained":false,"historicalAffected":[]}],"coverage":[]}