We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 96aef9f + 53a1f93 commit 3adc0b5Copy full SHA for 3adc0b5
1 file changed
cpp/ql/src/Security/CWE/CWE-319/UseOfHttp.ql
@@ -28,6 +28,11 @@ class PrivateHostName extends string {
28
}
29
30
31
+pragma[nomagic]
32
+predicate privateHostNameFlowsToExpr(Expr e) {
33
+ TaintTracking::localExprTaint(any(StringLiteral p | p.getValue() instanceof PrivateHostName), e)
34
+}
35
+
36
/**
37
* A string containing an HTTP URL not in a private domain.
38
*/
@@ -38,11 +43,9 @@ class HttpStringLiteral extends StringLiteral {
43
or
39
44
exists(string tail |
40
45
tail = s.regexpCapture("http://(.*)", 1) and not tail instanceof PrivateHostName
41
- ) and
42
- not TaintTracking::localExprTaint(any(StringLiteral p |
- p.getValue() instanceof PrivateHostName
- ), this.getParent*())
- )
46
+ )
47
+ ) and
48
+ not privateHostNameFlowsToExpr(this.getParent*())
49
50
51
0 commit comments