diff --git a/rust/ql/lib/codeql/rust/internal/PathResolutionConsistency.qll b/rust/ql/lib/codeql/rust/internal/PathResolutionConsistency.qll index 37de5d35815..e3416b1480b 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolutionConsistency.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolutionConsistency.qll @@ -8,9 +8,6 @@ private import PathResolution /** Holds if `p` may resolve to multiple items including `i`. */ query predicate multiplePathResolutions(Path p, ItemNode i) { p.fromSource() and - not p.(AstNode).isInMacroExpansion() and - // exclude paths inside attributes (e.g. `#[tokio::main]`) - not p.getParentNode*() instanceof Attr and i = resolvePath(p) and // `panic` is defined in both `std` and `core`; both are included in the prelude not p.getText() = "panic" and diff --git a/rust/ql/test/library-tests/dataflow/sources/net/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/dataflow/sources/net/CONSISTENCY/PathResolutionConsistency.expected index 4388f45f296..5be3b149001 100644 --- a/rust/ql/test/library-tests/dataflow/sources/net/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/dataflow/sources/net/CONSISTENCY/PathResolutionConsistency.expected @@ -1,3 +1,6 @@ multipleResolvedTargets | test.rs:23:26:23:66 | ... .text() | | test.rs:26:26:26:67 | ... .bytes() | +multiplePathResolutions +| test.rs:517:3:517:13 | ...::main | +| test.rs:563:5:563:6 | ...::runtime | diff --git a/rust/ql/test/query-tests/security/CWE-918/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/query-tests/security/CWE-918/CONSISTENCY/PathResolutionConsistency.expected index ac7fc3cad3f..eb6f8590fbd 100644 --- a/rust/ql/test/query-tests/security/CWE-918/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/query-tests/security/CWE-918/CONSISTENCY/PathResolutionConsistency.expected @@ -1,2 +1,4 @@ multiplePathResolutions +| request_forgery_tests.rs:60:7:60:17 | ...::main | +| request_forgery_tests.rs:64:9:64:11 | ...::runtime | | request_forgery_tests.rs:79:5:79:18 | ...::runtime |