Validation regex hangs the browser tab on crafted user input (ReDoS)
Nested quantifiers in NFA regular expressions cause exponential backtracking on near-matching strings, locking up the JS thread.
Main thread frozen 100% inside RegExp.prototype.test; DevTools Flame Chart shows catastrophic backtrackingCausal Chain of Browser Mechanisms
Ordered from trigger to root invariant. Open any mechanism to inspect its internals or reproduce the behavior in an interactive lab.
Prevent catastrophic O(2^n) main-thread ReDoS freezes and broken 16-bit emoji splits—understand Irregexp's backtracking NFA and use /u or /v Unicode modes.
Fix sluggish clicks and fail-threshold INP (>200 ms) by breaking >50 ms Long Tasks—Input Delay, Processing Duration, and Presentation Delay all compete on one main thread.
Prevents silent TypeError crashes from drifted API payloads and corrupted localStorage by parsing untrusted JSON at I/O boundaries into typed structures without blocking INP.