~/talk

Total ReDoS: the Dangers of Regex in JavaScript

slides:none on file

Regular expressions can cause ReDoS where simple patterns explode into massive work: a whitespace-trimming pattern runs into 200 million steps when faced with 20,000 spaces and causes a 34-minute outage on Stack Overflow; a dot-star-dot pattern triggers 27 minute outage at Cloudflare; node-fetch’s localhost check produces exponential backtracking. Fixes include limiting input length, using built-in trim, refactoring overlaps (e.g. [^.] instead of .), using lookaround/fake-atomic tricks, switching to RE2, and scanning with tools like recheck and eslint-plugin-redos, regex101, Regexper and the Rex debugger.

AI-written summary · about

  1. 0:00Introduction
  2. 1:01Why regex dangers
  3. 3:27Backtrack overflow
  4. 9:26Fixing backtrack overflow
  5. 13:17Catastrophic backtracking
  6. 23:12Email regex pitfalls
  7. 28:12Refactoring nested qualifiers
  8. 33:07Avoiding regex entirely
  9. 34:31Alternative regex engines
  10. 35:13Tools to detect redos
  11. 36:59Summary and tools
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.