fix: allow framework route patterns in path validation#44
Conversation
The path traversal regex was too broad - r"\.\." blocked any occurrence of ".." including valid Next.js catch-all routes like [[...slug]]. Changed to r"(?:^|[\\/])\.\.(?:[\\/]|$)" which only matches ".." when it appears as a standalone path component (actual traversal patterns). Now correctly: - Blocks: ../foo, foo/../bar, foo/.., ..\bar - Allows: [[...slug]], [...slug], foo...bar, file..txt
|
CodeAnt AI is reviewing your PR. |
Nitpicks 🔍
|
|
CodeAnt AI finished reviewing your PR. |
The path traversal regex was too broad - r".." blocked any occurrence of ".." including valid Next.js catch-all routes like [[...slug]].
Changed to r"(?:^|[\/])..(?:[\/]|$)" which only matches ".." when it appears as a standalone path component (actual traversal patterns).
Now correctly: