Skip to content

Commit 4b947db

Browse files
authored
Merge pull request #19804 from geoffw0/dotdot
Rust: Update DotDotCheck to use getCanonicalPath
2 parents 2951ae9 + 7f65980 commit 4b947db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rust/ql/lib/codeql/rust/security/TaintedPathExtensions.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ module SanitizerGuard {
6969
*/
7070
private class DotDotCheck extends SanitizerGuard::Range, CfgNodes::MethodCallExprCfgNode {
7171
DotDotCheck() {
72-
this.getAstNode().(Resolvable).getResolvedPath() = "<str>::contains" and
72+
this.getAstNode().(CallExprBase).getStaticTarget().(Addressable).getCanonicalPath() =
73+
["<alloc::string::String>::contains", "<core::str>::contains"] and
7374
this.getArgument(0).getAstNode().(LiteralExpr).getTextValue() =
7475
["\"..\"", "\"../\"", "\"..\\\""]
7576
}

0 commit comments

Comments
 (0)