~/talk

Total ReDoS: The Dangers of regex in JavaScript

Talkat XtremeJS 2024 · 2024-11-12..11-13· [security]
slides:none on file

JavaScript regular expressions can hit catastrophic backtracking and block the event loop: a node‑fetch URL regex forces exponential steps (Rex101 shows 12,294 → 24,582 → 49k as characters are added), a crafted Cloudflare regex causes a 27-minute outage, Superhuman’s email regex stalls the UI for ~7.3s in tests, and a Zod pattern also backtracks badly. Detection uses Rex101, regexper, redex timer, recheck or ESLint plugins; fixes are to remove overlapping quantifiers, replace with string methods (endsWith/equals) or switch to re2.

AI-written summary · about

  1. 0:00Introduction
  2. 1:02What is ReDoS
  3. 3:31Node fetch’s backtracking flaw
  4. 10:55Cloudflare’s outage cause
  5. 15:04Superhuman’s regex lockups
  6. 18:22Zod’s email validation flaws
  7. 21:14Fixing overlapping regex patterns
  8. 23:20Alternatives to vulnerable regexes
  9. 24:23Tools for ReDoS detection
~/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.