Skip to content

Commit 474815b

Browse files
authored
Merge pull request #2660 from calumgrant/cs/release-notes
C#: Add release notes and precisions to queries
2 parents d7e8ea7 + c0379cc commit 474815b

File tree

5 files changed

+10
-29
lines changed

5 files changed

+10
-29
lines changed

change-notes/1.24/analysis-csharp.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ The following changes in version 1.24 affect C# analysis in all applications.
66

77
| **Query** | **Tags** | **Purpose** |
88
|-----------------------------|-----------|--------------------------------------------------------------------|
9+
| Assembly path injection (`cs/assembly-path-injection`) | security, external/cwe/cwe-114 | Finds user-controlled data used to load an assembly. |
910
| Insecure configuration for ASP.NET requestValidationMode (`cs/insecure-request-validation-mode`) | security, external/cwe/cwe-016 | Finds where this attribute has been set to a value less than 4.5, which turns off some validation features and makes the application less secure. |
10-
| Page request validation is disabled (`cs/web/request-validation-disabled`) | security, frameworks/asp.net, external/cwe/cwe-016 | Finds where ASP.NET page request validation has been disabled, which could makes the application less secure. |
11+
| Insecure SQL connection (`cs/insecure-sql-connection`) | security, external/cwe/cwe-327 | Finds unencrypted SQL connection strings. |
12+
| Page request validation is disabled (`cs/web/request-validation-disabled`) | security, frameworks/asp.net, external/cwe/cwe-016 | Finds where ASP.NET page request validation has been disabled, which could make the application less secure. |
13+
| Serialization check bypass (`cs/serialization-check-bypass`) | security, external/cwe/cwe-20 | Finds where data is not validated in a deserialization method. |
14+
| XML injection (`cs/xml-injection`) | security, external/cwe/cwe-091 | Finds user-controlled data that is used to write directly to an XML document. |
1115

1216
## Changes to existing queries
1317

@@ -30,4 +34,3 @@ The following changes in version 1.24 affect C# analysis in all applications.
3034
* Expression nullability flow state is given by the predicates `Expr.hasNotNullFlowState()` and `Expr.hasMaybeNullFlowState()`.
3135

3236
## Changes to autobuilder
33-

csharp/ql/src/Security Features/CWE-020/RuntimeChecksBypass.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
* @kind problem
55
* @id cs/serialization-check-bypass
66
* @problem.severity warning
7+
* @precision medium
78
* @tags security
89
* external/cwe/cwe-20
910
*/
1011

11-
/*
12-
* consider: @precision medium
13-
*/
14-
1512
import semmle.code.csharp.serialization.Serialization
1613
import semmle.code.csharp.controlflow.Guards
1714

csharp/ql/src/Security Features/CWE-091/XMLInjection.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
* @kind problem
66
* @id cs/xml-injection
77
* @problem.severity error
8+
* @precision high
89
* @tags security
910
* external/cwe/cwe-091
1011
*/
1112

12-
/*
13-
* consider: @precision high
14-
*/
15-
1613
import csharp
1714
import semmle.code.csharp.dataflow.flowsources.Remote
1815
import semmle.code.csharp.frameworks.system.Xml

csharp/ql/src/Security Features/CWE-114/AssemblyPathInjection.ql

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,14 @@
66
* @kind problem
77
* @id cs/assembly-path-injection
88
* @problem.severity error
9+
* @precision high
910
* @tags security
1011
* external/cwe/cwe-114
1112
*/
1213

13-
/*
14-
* consider: @precision high
15-
*/
16-
1714
import csharp
1815
import semmle.code.csharp.dataflow.flowsources.Remote
19-
20-
class MainMethod extends Method {
21-
MainMethod() {
22-
this.hasName("Main") and
23-
this.isStatic() and
24-
(this.getReturnType() instanceof VoidType or this.getReturnType() instanceof IntType) and
25-
if this.getNumberOfParameters() = 1
26-
then this.getParameter(0).getType().(ArrayType).getElementType() instanceof StringType
27-
else this.getNumberOfParameters() = 0
28-
}
29-
}
16+
import semmle.code.csharp.commons.Util
3017

3118
/**
3219
* A taint-tracking configuration for untrusted user input used to load a DLL.

csharp/ql/src/Security Features/CWE-327/InsecureSQLConnection.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
* @kind path-problem
55
* @id cs/insecure-sql-connection
66
* @problem.severity error
7+
* @precision medium
78
* @tags security
89
* external/cwe/cwe-327
910
*/
1011

11-
/*
12-
* consider: @precision high
13-
*/
14-
1512
import csharp
1613
import DataFlow::PathGraph
1714

0 commit comments

Comments
 (0)