Skip to content

Commit b7a3961

Browse files
committed
Prevent name collision by introducing new module
1 parent 38e72b3 commit b7a3961

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

vapi-customizations/advanced_security_demo/vapi_customizations/Customizations.qll

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ import python
22
private import semmle.python.ApiGraphs
33
private import semmle.python.dataflow.new.RemoteFlowSources
44

5-
API::Node request() { result = API::moduleImport("connexion").getMember("request") }
5+
module Connexion {
6+
API::Node request() { result = API::moduleImport("connexion").getMember("request") }
67

7-
private class ConnexionRequestSource extends RemoteFlowSource::Range {
8-
ConnexionRequestSource() {
9-
this = request().getAUse() and
10-
not any(Import imp).contains(this.asExpr()) and
11-
not exists(ControlFlowNode def | this.asVar().getSourceVariable().hasDefiningNode(def) |
12-
any(Import imp).contains(def.getNode())
13-
)
14-
}
8+
private class ConnexionRequestSource extends RemoteFlowSource::Range {
9+
ConnexionRequestSource() {
10+
this = request().getAUse() and
11+
not any(Import imp).contains(this.asExpr()) and
12+
not exists(ControlFlowNode def | this.asVar().getSourceVariable().hasDefiningNode(def) |
13+
any(Import imp).contains(def.getNode())
14+
)
15+
}
1516

16-
override string getSourceType() { result = "connexion.request" }
17+
override string getSourceType() { result = "connexion.request" }
18+
}
1719
}

0 commit comments

Comments
 (0)