diff --git a/rust/ql/lib/codeql/rust/security/regex/RegexInjectionExtensions.qll b/rust/ql/lib/codeql/rust/security/regex/RegexInjectionExtensions.qll index 4daff543b980..61d26f2f938b 100644 --- a/rust/ql/lib/codeql/rust/security/regex/RegexInjectionExtensions.qll +++ b/rust/ql/lib/codeql/rust/security/regex/RegexInjectionExtensions.qll @@ -53,11 +53,10 @@ module RegexInjection { */ private class NewSink extends Sink { NewSink() { - exists(CallExprCfgNode call, PathExpr path | - path = call.getFunction().getExpr() and - path.getResolvedCrateOrigin() = "repo:https://github.com/rust-lang/regex:regex" and - path.getResolvedPath() = "::new" and - this.asExpr() = call.getArgument(0) and + exists(CallExprBase call, Addressable a | + call.getStaticTarget() = a and + a.getCanonicalPath() = "::new" and + this.asExpr().getExpr() = call.getArg(0) and not this.asExpr() instanceof LiteralExprCfgNode ) }