Skip to content

Instantly share code, notes, and snippets.

@Lawlez
Created February 25, 2021 13:38
Show Gist options
  • Save Lawlez/56a4e92d11878e5d777e612f4c4bb5a6 to your computer and use it in GitHub Desktop.
Save Lawlez/56a4e92d11878e5d777e612f4c4bb5a6 to your computer and use it in GitHub Desktop.
How to Detect ReDoS in your JS regex
#evil regex
1. install rxxr2: https://www.cs.bham.ac.uk/~hxt/research/rxxr2/
2. test regex with rxxr2: ./scan.bin /(a+)+/
visualize regex with https://regexper.com/
further analysis tools:
https://github.com/NicolaasWeideman/RegexStaticAnalysis
https://github.com/davisjam/vuln-regex-detector
https://github.com/substack/safe-regex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment