Repository navigation
Commit 2195258
fix(lab): rewrite raw POSIX path regex without ambiguous alternation
Code scanning flagged RAW_POSIX_PATH_RE as polynomial ReDoS (alert #1):
the `(?:\/|[^/\0\r\n]+)+` alternation can repartition a run of path
segments combinatorially on client-supplied event fields. Rewrite the
segment run as an unambiguous `[^/]+(?:\/+[^/]+)*\/*` sequence so the
match stays linear. The exec-side sibling regex was already rewritten
on dev; this closes the remaining flagged pattern.
Co-Authored-By: Epinephrine <[email protected]>1 parent 5cdd97e commit 2195258
2 files changed
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
227 | 251 | | |
228 | 252 | | |
229 | 253 | | |
| |||
0 commit comments