Commit 405fbfc
committed
fix(security): regex-audit missing inline-literal detection for .ts/.tsx/.jsx/.mjs/.cjs
Only .js had the 'regex_literal_inline' pattern (bare /pattern/flags used
directly as a call argument, e.g. .replace(/[-:T]/g, '')). Every other JS
family extension — .mjs, .cjs, .ts, .tsx, .jsx — was missing it, so any
inline (non-variable-assigned) regex literal in TypeScript/JSX went
completely undetected.
Found via real-codebase validation (Coretax-Auto-Downloader KDS backend,
all .ts): regex-audit reported total_patterns:0 despite genuine inline
regex literals (.replace(/[-:T]/g, ''), .replace(/\s+/g, '.')) confirmed
present via grep.
Fix: add the same inline-literal pattern already used for .js to the
other 4 extensions. Verified: total_patterns went from 0 to 1735,
vulnerable stayed 0 (no ReDoS-prone patterns in this codebase) — the
inline pattern is inherently noisy for raw counting (same tradeoff .js
already accepted), but doesn't affect the vulnerability-flagging logic.1 parent e82440d commit 405fbfc
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
82 | 89 | | |
83 | 90 | | |
84 | 91 | | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
| 97 | + | |
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
| 102 | + | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| 107 | + | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
| 112 | + | |
101 | 113 | | |
102 | 114 | | |
103 | 115 | | |
| |||
0 commit comments