Regular Expression Security Cheatsheet

Revision as of 10:41, 9 October 2016 by Jmanico (talk | contribs) (Cheatsheet)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Regular Expression Security Cheatsheet


This cheatsheet can be effectively used by security specialists and programmers to reveal unwanted constructions in regular expressions. This can cause bypass of intended validation rules.


Here is a link to the GitHub RegEx repository:


In order to save time for security practitioners, Static Application Security Testing tool was written. You can use the following code to analyze all regular expressions from your project:
grep -iorP "reg_\w+\s*\((\s*['\"](.*?)['\"])," * > regexp.txt && php index.php --file="./regexp.txt"

SAST can be downloaded from here:

Authors and Primary Editors

Vladimir Ivanov