CVE-2025-69211

7.4 HIGH

📋 TL;DR

NestJS applications using Fastify platform with route-specific middleware are vulnerable to URL encoding bypass. This allows attackers to access protected routes without authentication or authorization checks. Only applications using @nestjs/platform-fastify with middleware applied to specific routes are affected.

💻 Affected Systems

Products:
  • NestJS
  • @nestjs/platform-fastify
Versions: All versions prior to 11.1.11
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when using: 1) @nestjs/platform-fastify, 2) NestMiddleware via MiddlewareConsumer or app.use(), 3) Route-specific middleware application

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete authentication/authorization bypass leading to unauthorized administrative access, data exposure, or privilege escalation.

🟠

Likely Case

Unauthorized access to protected endpoints, potentially exposing sensitive data or allowing unauthorized actions.

🟢

If Mitigated

Limited impact if additional security layers (application-level checks, network segmentation) are in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires crafting specially encoded URLs to bypass middleware path matching

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: @nestjs/platform-fastify@11.1.11

Vendor Advisory: https://github.com/nestjs/nest/security/advisories/GHSA-8wpr-639p-ccrj

Restart Required: Yes

Instructions:

Update package.json to specify "@nestjs/platform-fastify": "^11.1.11"
Run: npm update @nestjs/platform-fastify
Restart the application

🔧 Temporary Workarounds

Switch to Express Platform

all

Temporarily switch from Fastify to Express platform which is not affected

npm uninstall @nestjs/platform-fastify
npm install @nestjs/platform-express
Update main.ts to use ExpressAdapter

Apply Global Middleware

all

Apply security middleware globally instead of route-specific to avoid bypass

In AppModule: apply middleware globally using app.use() or MiddlewareConsumer without .forRoutes()

🧯 If You Can't Patch

  • Implement additional authentication checks at controller/service level
  • Use network-level access controls to restrict sensitive endpoints

🔍 How to Verify

Check if Vulnerable:

Check package.json for @nestjs/platform-fastify version <11.1.11 and verify route-specific middleware usage

Check Version:

npm list @nestjs/platform-fastify

Verify Fix Applied:

Verify package.json shows @nestjs/platform-fastify version >=11.1.11 and test protected routes with encoded URLs

📡 Detection & Monitoring

Log Indicators:

  • Unusual access patterns to protected routes
  • Requests with encoded characters in URLs to middleware-protected endpoints

Network Indicators:

  • HTTP requests to protected endpoints without authentication headers
  • URLs with multiple encoding patterns

SIEM Query:

source="application_logs" AND (url CONTAINS "%" AND path IN ["protected_endpoints"])

🔗 References

📤 Share & Export