~/talk

Service Denied! Understanding How Regex DoS Attacks Work

Talkat RailsConf 2022 · 2022-05-17..05-19· [ruby, security]
slides:none on file

Specially formatted strings can knock a Rails app offline by triggering exponential work in CRuby’s backtracking regex engine; the talk inspects the CRuby internals, shows 36-character input taking 7 minutes on a pathological pattern, and demonstrates a DFA-based engine that runs the same case in 22 seconds vs 22 milliseconds. Concrete defenses include never allow users to supply regexes, truncating inputs, upgrading Ruby/Rails, and using regex timeouts (Ruby 3.2 adds them) or simpler patterns to avoid nested quantifiers.

AI-written summary · about

  1. 0:00Introduction
  2. 2:21TruffleRuby benchmarks
  3. 3:24Talk structure
  4. 4:06ReDoS in 2021
  5. 5:09Motivation for research
  6. 6:55Denial of service attack
  7. 8:59Regex DoS attacks
  8. 10:02Benchmark limitations
  9. 11:45Algorithmic complexity
  10. 13:09Big O notation
  11. 15:33ReDoS exponential example
  12. 16:57Regular expressions
  13. 18:41Regex engines NFAs vs DFAs
  14. 21:50Backtracking risks
  15. 23:53DFA linear matching
  16. 24:35Expressiveness of NFAs and DFAs
  17. 25:17Rails ReDoS impact
  18. 25:38Preventing ReDoS attacks
  19. 27:00Ruby Rails ReDoS response
  20. 27:42Safer regex patterns
  21. 29:06Pathological cases
  22. 29:27Big O for performance
  23. 30:09Further reading
~/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.