Commit 40d37b1
committed
fix: detect (a+)+ as vulnerable in AUTO mode (issue #2)
The pattern (a+)+ was incorrectly reported as safe due to flawed logic
in _is_multi_trans_exploitable that assumed unanchored patterns could
always "escape early". This is only true for optional quantifiers like
(a*)*, not for required quantifiers like (a+)+.
Changed AUTO mode to be conservative by always reporting multi-transitions
as exploitable. Users who want lenient analysis can use match_mode=PARTIAL.
Added regression test for issue #2.1 parent 76daeac commit 40d37b1
File tree
2 files changed
+24
-8
lines changed- src/redoctor/automaton
- tests
2 files changed
+24
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
337 | 332 | | |
338 | 333 | | |
339 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
0 commit comments