File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
query-tests/Security/CWE-020 Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ predicate used_as_regex(Expr s, string mode) {
2828 /* Call to re.xxx(regex, ... [mode]) */
2929 exists ( CallNode call , string name |
3030 call .getArg ( 0 ) .refersTo ( _, _, s .getAFlowNode ( ) ) and
31- call .getFunction ( ) .pointsTo ( Module:: named ( "re" ) .attr ( name ) )
31+ call .getFunction ( ) .pointsTo ( Module:: named ( "re" ) .attr ( name ) ) and
32+ not name = "escape"
3233 |
3334 mode = "None"
3435 or
Original file line number Diff line number Diff line change 6262re .compile (r"\[(?P<txt>[^[]*)\]\((?P<uri>[^)]*)" )
6363
6464re .compile ("" , re .M ) # ODASA-8056
65+
66+ # FP reported in https://github.com/github/codeql/issues/3712
67+ # This does not define a regex (but could be used by other code to do so)
68+ escaped = re .escape ("https://www.humblebundle.com/home/library" )
Original file line number Diff line number Diff line change @@ -17,3 +17,7 @@ def safe(request):
1717 target = request .args .get ('target' , '' )
1818 if SAFE_REGEX .match (target ):
1919 return redirect (target )
20+
21+ # FP reported in https://github.com/github/codeql/issues/3712
22+ # This does not define a regex (but could be used by other code to do so)
23+ escaped = re .escape ("https://www.humblebundle.com/home/library" )
You can’t perform that action at this time.
0 commit comments