Skip to content

Commit 668950a

Browse files
committed
Update vulnerable call location query logic
Replaces usage of getEnclosingVulnerableMethod and getCallTargetFullyQualifiedName with getEnclosingFunction and a more precise extraction of the target operand's fully qualified name using IR. Also adds import for IR module to support new logic.
1 parent 0213891 commit 668950a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

binary/ql/src/VulnerableCalls/VulnerableCallsSummarize.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
import VulnerableCalls
10+
import semmle.code.binary.ast.ir.IR
1011

1112
/**
1213
* Exports all methods that can reach vulnerable calls.
@@ -39,6 +40,6 @@ query predicate vulnerableCallLocations(
3940
string id
4041
) {
4142
call.getVulnerabilityId() = id and
42-
call.getEnclosingVulnerableMethod().hasFullyQualifiedName(callerNamespace, callerClassName, callerMethodName) and
43-
targetFqn = call.getCallTargetFullyQualifiedName()
43+
call.getEnclosingFunction().hasFullyQualifiedName(callerNamespace, callerClassName, callerMethodName) and
44+
targetFqn = call.getTargetOperand().getAnyDef().(ExternalRefInstruction).getFullyQualifiedName()
4445
}

0 commit comments

Comments
 (0)