davisjam / vuln-regex-detector

Detect vulnerable regexes in your project. REDOS, catastrophic backtracking.
MIT License
316 stars 27 forks source link

Add support for HTML file to extract-regexes.pl #77

Closed du201 closed 3 years ago

du201 commented 3 years ago

Summary

extract-regexes.pl used to only support python and js files. I added support for html files so that now extract-regexes.pl can process three types of files

Implementation Details

The input html file is first processed by beautifulsoup to combine all of its script tags' content into a new, temporary js file. Then, that js file is fed into the already-existing javascript extractor. After it's done, the temporary js file is deleted. A new test for html file is also created in ./src/extract/test/html

davisjam commented 3 years ago

LGTM, thank you.