Skip to content

Commit 1d8b19e

Browse files
committed
Adjust coverage report generator to allow multiple sink identifiers per CWE
1 parent 2a75989 commit 1d8b19e

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
package,sink,source,summary,sink:html,source:local,summary:taint
2-
System,4,3,6,4,3,6
1+
package,sink,source,summary,sink:html,sink:xss,source:local,summary:taint
2+
System,5,3,6,4,1,3,6

csharp/documentation/library-coverage/coverage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ C# framework & library support
77
:widths: auto
88

99
Framework / library,Package,Remote flow sources,Taint & value steps,Sinks (total),`CWE-079` :sub:`Cross-site scripting`
10-
System,"``System.*``, ``System``",,6,4,4
11-
Totals,,,6,4,4
10+
System,"``System.*``, ``System``",,6,5,5
11+
Totals,,,6,5,5
1212

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
CWE,Sink identifier,Label
2-
CWE-079,html,Cross-site scripting
2+
CWE-079,html xss,Cross-site scripting

misc/scripts/library-coverage/generate-report.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ def collect_package_stats(packages: pack.PackageCollection, cwes, filter):
5252
sinks += package.get_part_count("sink")
5353

5454
for cwe in cwes:
55-
sink = "sink:" + cwes[cwe]["sink"]
56-
count = package.get_kind_count(sink)
55+
count = 0
56+
for sink in cwes[cwe]["sink"].split(" "):
57+
sink = "sink:" + sink
58+
count += package.get_kind_count(sink)
5759
if count > 0:
5860
if cwe not in framework_cwes:
5961
framework_cwes[cwe] = 0

0 commit comments

Comments
 (0)