Skip to content

Commit be68b6f

Browse files
committed
C#: Add precision to queries
1 parent 80997a3 commit be68b6f

File tree

4 files changed

+6
-28
lines changed

4 files changed

+6
-28
lines changed

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: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
/**
22
* @name Insecure SQL connection
3-
* @description Using an SQL Server connection without enforcing encryption is a security vulnerability.
3+
* @description Using a SQL Server connection without enforcing encryption is a security vulnerability.
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)