Skip to content

Commit 5ad060c

Browse files
committed
C#: qhelp for VulnerablePackage.
1 parent ff3ed2d commit 5ad060c

File tree

4 files changed

+73
-1
lines changed

4 files changed

+73
-1
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import csharp
1111
import Vulnerability
1212

1313
class MicrosoftAdvisory4021279 extends Vulnerability {
14-
1514
MicrosoftAdvisory4021279() { this = "Microsoft Security Advisory 4021279" }
1615

1716
override string getUrl() { result = "https://github.com/dotnet/corefx/issues/19535" }
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE qhelp PUBLIC
2+
"-//Semmle//qhelp//EN"
3+
"qhelp.dtd">
4+
<qhelp>
5+
6+
<overview>
7+
<p>
8+
Using a package with a known vulnerability is a security risk that could leave the
9+
software vulnerable to attack.
10+
</p>
11+
<p>
12+
This query reads the packages imported by the project build files and
13+
<code>.config</code> files, and checks them against a list of packages with known
14+
vulnerabilities.
15+
</p>
16+
</overview>
17+
18+
<recommendation>
19+
<p>
20+
Upgrade the package to the recommended version, for example using the NuGet package manager,
21+
or by editing the project files directly.
22+
</p>
23+
</recommendation>
24+
25+
<example>
26+
<p>
27+
The following example shows a C# project file referencing package <code>System.Net.Http</code>
28+
version 4.3.1, which is vulnerable to <a href="https://github.com/dotnet/announcements/issues/88">CVE-2018-8292</a>.
29+
</p>
30+
<sample src="VulnerablePackageBAD.csproj" />
31+
<p>
32+
The project file can be fixed by changing the version of the package to 4.3.4.
33+
</p>
34+
<sample src="VulnerablePackageGOOD.csproj" />
35+
</example>
36+
37+
<references>
38+
<li>
39+
OWASP: <a href="https://www.owasp.org/index.php/Top_10-2017_A9-Using_Components_with_Known_Vulnerabilities">A9-Using Components with Known Vulnerabilities</a>.
40+
</li>
41+
</references>
42+
43+
</qhelp>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
<AssemblyName>Semmle.Autobuild</AssemblyName>
6+
<RootNamespace>Semmle.Autobuild</RootNamespace>
7+
<OutputType>Exe</OutputType>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.Build" Version="15.8.166" />
12+
<PackageReference Include="System.Net.Http" Version="4.3.1" />
13+
</ItemGroup>
14+
15+
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
<AssemblyName>Semmle.Autobuild</AssemblyName>
6+
<RootNamespace>Semmle.Autobuild</RootNamespace>
7+
<OutputType>Exe</OutputType>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.Build" Version="15.8.166" />
12+
<PackageReference Include="System.Net.Http" Version="4.3.4" />
13+
</ItemGroup>
14+
15+
</Project>

0 commit comments

Comments
 (0)