fix: correct dashboard route regex pattern to prevent false matches (qa-requested)

Fixes regex pattern vulnerability in middleware route matching.

Changed pattern from:
  /^\/(de|en|sr)\/dashboard/

To:
  /^\/(de|en|sr)\/dashboard(\/|$)/

This ensures the pattern only matches:
- /de/dashboard (exact match)
- /de/dashboard/ (with trailing slash)
- /de/dashboard/settings (sub-routes)

But NOT:
- /de/dashboardx (no boundary)
- /de/dashboard-other (no boundary)
- /de/dashboard-admin (no boundary)

Verified:
- Regex pattern test: all 10 tests passed
- TypeScript compilation: passed
- No security vulnerabilities

QA Fix Session: 1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-25 12:06:33 +01:00
co-authored by Claude Sonnet 4.5
parent bbc897de08
commit b5ea03ca58
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -81,4 +81,7 @@ supabase/.temp/
.history/
# Source images (originals before optimization)
source-images/
source-images/
# Auto Claude data directory
.auto-claude/