Skip to content

Commit 61232cb

Browse files
committed
C#: Address review comments in QL.
1 parent 6e96fba commit 61232cb

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

csharp/ql/src/Security Features/CWE-937/Vulnerabilities.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* A list of NuGet packages with known vulnerabilities.
2+
* Provides a list of NuGet packages with known vulnerabilities.
33
*
44
* To add a new vulnerability follow the existing pattern.
55
* Create a new class that extends the abstract class `Vulnerability`,
@@ -113,11 +113,13 @@ class AspNetCore_Mar18 extends Vulnerability {
113113
name = "Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions"
114114
or
115115
name = "Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv"
116-
or
117-
name = "Microsoft.AspNetCore.All"
118116
) and
119117
affected = "2.0.0" and
120118
fixed = "2.0.3"
119+
or
120+
name = "Microsoft.AspNetCore.All" and
121+
affected = "2.0.0" and
122+
fixed = "2.0.8"
121123
}
122124
}
123125

csharp/ql/src/Security Features/CWE-937/Vulnerability.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import csharp
22

33
/**
44
* A package reference in an XML file, for example in a
5-
* .csproj file, a .props file or a packages.config file.
5+
* `.csproj` file, a `.props` file, or a `packages.config` file.
66
*/
77
class Package extends XMLElement {
88
string name;
@@ -43,16 +43,16 @@ abstract class Vulnerability extends string {
4343
Vulnerability() { any() }
4444

4545
/**
46-
* A package with name `name` is vulnerable from version `affected`
46+
* Holds if a package with name `name` is vulnerable from version `affected`
4747
* until version `fixed`.
4848
*/
4949
predicate matchesRange(string name, Version affected, Version fixed) { none() }
5050

5151
/**
52-
* A package with name `name` is vulnerable in version `affected`, and
52+
* Holds if a package with name `name` is vulnerable in version `affected`, and
5353
* is fixed by version `fixed`.
5454
*/
55-
predicate matchesVersion(string name, Version affecter, Version fixed) { none() }
55+
predicate matchesVersion(string name, Version affected, Version fixed) { none() }
5656

5757
/** Gets the URL describing the vulnerability. */
5858
abstract string getUrl();

csharp/ql/src/Security Features/CWE-937/VulnerablePackage.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ import Vulnerabilities
1515

1616
from Vulnerability vuln, VulnerablePackage package
1717
where vuln = package.getVulnerability()
18-
select package, "Package " + package + " has vulnerability $@, and should be upgraded to version " + package.getFixedVersion() + ".",
18+
select package, "Package '" + package + "' has vulnerability $@, and should be upgraded to version " + package.getFixedVersion() + ".",
1919
vuln.getUrl(), vuln.toString()
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
| csproj.config:10:5:10:77 | System.Text.Encodings.Web 4.3.0 | Package System.Text.Encodings.Web 4.3.0 has vulnerability $@, and should be upgraded to version 4.3.1. | https://github.com/dotnet/corefx/issues/19535 | Microsoft Security Advisory 4021279 |
2-
| csproj.config:11:5:11:75 | system.text.encodings.web 4.3 | Package system.text.encodings.web 4.3 has vulnerability $@, and should be upgraded to version 4.3.1. | https://github.com/dotnet/corefx/issues/19535 | Microsoft Security Advisory 4021279 |
3-
| csproj.config:12:5:12:67 | System.Net.Http 4.1.1 | Package System.Net.Http 4.1.1 has vulnerability $@, and should be upgraded to version 4.1.2. | https://github.com/dotnet/corefx/issues/19535 | Microsoft Security Advisory 4021279 |
4-
| csproj.config:13:5:13:67 | System.Net.Http 4.1.2 | Package System.Net.Http 4.1.2 has vulnerability $@, and should be upgraded to version 4.3.4. | https://github.com/dotnet/announcements/issues/88 | CVE-2018-8292 |
5-
| packages.config:8:3:8:79 | System.IO.Pipelines 4.5.0 | Package System.IO.Pipelines 4.5.0 has vulnerability $@, and should be upgraded to version 4.5.1. | https://github.com/aspnet/Announcements/issues/316 | CVE-2018-8409 |
6-
| packages.config:9:3:9:81 | System.IO.Pipelines 4.5.0.0 | Package System.IO.Pipelines 4.5.0.0 has vulnerability $@, and should be upgraded to version 4.5.1. | https://github.com/aspnet/Announcements/issues/316 | CVE-2018-8409 |
1+
| csproj.config:10:5:10:77 | System.Text.Encodings.Web 4.3.0 | Package 'System.Text.Encodings.Web 4.3.0' has vulnerability $@, and should be upgraded to version 4.3.1. | https://github.com/dotnet/corefx/issues/19535 | Microsoft Security Advisory 4021279 |
2+
| csproj.config:11:5:11:75 | system.text.encodings.web 4.3 | Package 'system.text.encodings.web 4.3' has vulnerability $@, and should be upgraded to version 4.3.1. | https://github.com/dotnet/corefx/issues/19535 | Microsoft Security Advisory 4021279 |
3+
| csproj.config:12:5:12:67 | System.Net.Http 4.1.1 | Package 'System.Net.Http 4.1.1' has vulnerability $@, and should be upgraded to version 4.1.2. | https://github.com/dotnet/corefx/issues/19535 | Microsoft Security Advisory 4021279 |
4+
| csproj.config:13:5:13:67 | System.Net.Http 4.1.2 | Package 'System.Net.Http 4.1.2' has vulnerability $@, and should be upgraded to version 4.3.4. | https://github.com/dotnet/announcements/issues/88 | CVE-2018-8292 |
5+
| packages.config:8:3:8:79 | System.IO.Pipelines 4.5.0 | Package 'System.IO.Pipelines 4.5.0' has vulnerability $@, and should be upgraded to version 4.5.1. | https://github.com/aspnet/Announcements/issues/316 | CVE-2018-8409 |
6+
| packages.config:9:3:9:81 | System.IO.Pipelines 4.5.0.0 | Package 'System.IO.Pipelines 4.5.0.0' has vulnerability $@, and should be upgraded to version 4.5.1. | https://github.com/aspnet/Announcements/issues/316 | CVE-2018-8409 |

0 commit comments

Comments
 (0)