Skip to content

Commit 5e83ca4

Browse files
committed
Improve detection of transitive vulnerable calls
Enhanced the logic in getAVulnerableMethod to include transitive vulnerability detection via static targets for direct calls, in addition to external references. This broadens the coverage for identifying vulnerable methods.
1 parent d80ab2d commit 5e83ca4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

binary/ql/src/VulnerableCalls/VulnerableCalls.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,20 @@ Function getAVulnerableMethod(string id) {
9191
// Direct call to vulnerable method
9292
result = getADirectlyVulnerableMethod(id)
9393
or
94-
// Transitive: method calls another method that is vulnerable
94+
// Transitive: method calls another method that is vulnerable (via ExternalRef for external calls)
9595
exists(CallInstruction call, Function callee |
9696
call.getEnclosingFunction() = result and
9797
callee = getAVulnerableMethod(id) and
9898
call.getTargetOperand().getAnyDef().(ExternalRefInstruction).getFullyQualifiedName() =
9999
callee.getFullyQualifiedName()
100100
)
101101
or
102+
// Transitive: method calls another method that is vulnerable (via static target for direct calls)
103+
exists(CallInstruction call |
104+
call.getEnclosingFunction() = result and
105+
call.getStaticTarget() = getAVulnerableMethod(id)
106+
)
107+
or
102108
// Iterator/async: if a state machine's MoveNext is vulnerable,
103109
// the stub method that creates it is also vulnerable
104110
exists(Function stateMachine |

0 commit comments

Comments
 (0)