Summary
The HTMLInputElement.checkValidity() method constructed a RegExp directly from the user-controlled pattern property without any sanitization or timeout protection. This allowed an attacker to inject a regex with catastrophic backtracking, freezing the event loop.
Fix
Fixed in commit asymmetric-effort/NogginLessDom@25a3cba on main. Added:
- Pattern length limit (1024 characters)
- Nested quantifier detection (
hasNestedQuantifiers) that rejects patterns like (a+)+ before constructing the regex
- Patterns exceeding limits are treated as non-matching (safe default)
References
Summary
The
HTMLInputElement.checkValidity()method constructed aRegExpdirectly from the user-controlledpatternproperty without any sanitization or timeout protection. This allowed an attacker to inject a regex with catastrophic backtracking, freezing the event loop.Fix
Fixed in commit asymmetric-effort/NogginLessDom@25a3cba on
main. Added:hasNestedQuantifiers) that rejects patterns like(a+)+before constructing the regexReferences