Commit dbd3964
fix(extension): make isValidClassName regex non-backtracking
The class-name validation pattern in EmbeddedExtensionRepository used
ambiguous quantifiers where the inner character class allowed '$' and
the outer group matched '$'-prefixed segments. On input like 'A$A$A$A'
with a trailing mismatch, the engine explored exponentially many
partitions (CodeQL js/redos, alert #15).
Switch the three repetitions to possessive quantifiers (`*+`) so each
commit step is final. Semantics are preserved for all accepted and
rejected class names (verified against SecurityValidationTest).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e74a6e3 commit dbd3964
1 file changed
Lines changed: 2 additions & 1 deletion
File tree
- btrace-extension/src/main/java/org/openjdk/btrace/extension/impl
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| |||
0 commit comments