port the Python regex/redos queries to use the shared pack

This commit is contained in:
erik-krogh
2022-11-01 12:08:19 +01:00
parent 05605480ae
commit 4f11e2d25f
13 changed files with 39 additions and 2665 deletions

View File

@@ -14,7 +14,8 @@
* external/cwe/cwe-186
*/
import semmle.python.security.BadTagFilterQuery
private import semmle.python.RegexTreeView::RegexTreeView as TreeView
import codeql.regex.nfa.BadTagFilterQuery::Make<TreeView>
from HtmlMatchingRegExp regexp, string msg
where msg = min(string m | isBadRegexpFilter(regexp, m) | m order by m.length(), m) // there might be multiple, we arbitrarily pick the shortest one