Commit 59a0e3c
harden api-key scheme regexes against polynomial backtracking
CodeQL flagged `^(ApiKey|Bearer)\s+(.+)$` as polynomial-ReDoS: `\s+` and
`.+` both match whitespace, so an all-whitespace tail backtracks O(n²).
Anchor the capture to a non-whitespace first char (`\s+(\S.*)`) — linear,
same behaviour for every valid header. Clears the pre-existing ApiKey alert
too.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 1f18569 commit 59a0e3c
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
0 commit comments