Commit 03c1156
committed
refactor(radar): use path normalization for traversal check
Replace blocklist pattern matching with URL path normalization and
allowlist validation. The URL constructor normalizes paths (resolves
'..' and decodes percent-encoding), so we verify the final pathname
stays within /client/v4/radar/ scope.
This approach handles:
- URL-encoded traversal attempts (%2e%2e, %2f)
- Double encoding and other bypass techniques
- Future unknown bypass patterns (allowlist vs blocklist)1 parent f25ee40 commit 03c1156
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | 130 | | |
136 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
0 commit comments