Skip to content

Commit d8b58f2

Browse files
committed
Rust: Restrict ReqwestGet by crate origin.
1 parent 75a3c93 commit d8b58f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rust/ql/lib/codeql/rust/frameworks/Reqwest.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ private import codeql.rust.Concepts
99
* A call to `reqwest::get` or `reqwest::blocking::get`.
1010
*/
1111
private class ReqwestGet extends RemoteSource::Range {
12+
CallExpr ce;
13+
1214
ReqwestGet() {
13-
this.asExpr().getExpr().(CallExpr).getExpr().(PathExpr).getPath().getResolvedPath() =
14-
["crate::get", "crate::blocking::get"]
15+
this.asExpr().getExpr() = ce and
16+
ce.getExpr().(PathExpr).getPath().getResolvedCrateOrigin().matches("%reqwest") and
17+
ce.getExpr().(PathExpr).getPath().getResolvedPath() = ["crate::get", "crate::blocking::get"]
1518
}
1619
}

0 commit comments

Comments
 (0)