Skip to content

Commit 4f00666

Browse files
committed
C#: Add query and test case for supported external taint.
1 parent 03c1bf6 commit 4f00666

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

csharp/ql/src/Telemetry/ExternalAPI.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ExternalAPI extends Callable {
7373
}
7474

7575
/** Holds if this API has a supported summary. */
76-
private predicate hasSummary() {
76+
predicate hasSummary() {
7777
this.getUnboundDeclaration() = any(SummarizedCallable sc) or
7878
defaultAdditionalTaintStep(this.getAnInput(), _)
7979
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @name Supported flow steps in external libraries
3+
* @description A list of 3rd party APIs detected as flow steps. Excludes test and generated code.
4+
* @kind metric
5+
* @tags summary
6+
* @id csharp/telemetry/supported-external-api-taint
7+
*/
8+
9+
import csharp
10+
import ExternalAPI
11+
12+
from ExternalAPI api, int usages
13+
where
14+
not api.isUninteresting() and
15+
api.hasSummary() and
16+
usages = strictcount(Call c | c.getTarget() = api)
17+
select api.getInfo() as info, usages order by usages desc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| System.Private.CoreLib.dll#System.Collections.Generic#List<>.Add(object) | 2 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Telemetry/SupportedExternalTaint.ql

0 commit comments

Comments
 (0)