mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
JS: Restrict RegExp queries to actual regular expressions
This commit is contained in:
@@ -17,7 +17,8 @@ from RegExpNegativeLookahead neg, RegExpGroup grp, RegExpBackRef back
|
||||
where
|
||||
grp.getParent+() = neg and
|
||||
grp = back.getGroup() and
|
||||
not back.getParent+() = neg
|
||||
not back.getParent+() = neg and
|
||||
neg.isPartOfRegExpLiteral()
|
||||
select back,
|
||||
"This back reference always matches the empty string, since it refers to $@, which is contained in $@.",
|
||||
grp, "this capture group", neg, "a negative lookahead assertion"
|
||||
|
||||
Reference in New Issue
Block a user