mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Merge remote-tracking branch 'upstream/master' into dbartol/Indirections
This commit is contained in:
@@ -4,14 +4,11 @@
|
||||
* @kind problem
|
||||
* @id cs/serialization-check-bypass
|
||||
* @problem.severity warning
|
||||
* @precision medium
|
||||
* @tags security
|
||||
* external/cwe/cwe-20
|
||||
*/
|
||||
|
||||
/*
|
||||
* consider: @precision medium
|
||||
*/
|
||||
|
||||
import semmle.code.csharp.serialization.Serialization
|
||||
import semmle.code.csharp.controlflow.Guards
|
||||
|
||||
|
||||
@@ -5,14 +5,11 @@
|
||||
* @kind problem
|
||||
* @id cs/xml-injection
|
||||
* @problem.severity error
|
||||
* @precision high
|
||||
* @tags security
|
||||
* external/cwe/cwe-091
|
||||
*/
|
||||
|
||||
/*
|
||||
* consider: @precision high
|
||||
*/
|
||||
|
||||
import csharp
|
||||
import semmle.code.csharp.dataflow.flowsources.Remote
|
||||
import semmle.code.csharp.frameworks.system.Xml
|
||||
|
||||
@@ -6,27 +6,14 @@
|
||||
* @kind problem
|
||||
* @id cs/assembly-path-injection
|
||||
* @problem.severity error
|
||||
* @precision high
|
||||
* @tags security
|
||||
* external/cwe/cwe-114
|
||||
*/
|
||||
|
||||
/*
|
||||
* consider: @precision high
|
||||
*/
|
||||
|
||||
import csharp
|
||||
import semmle.code.csharp.dataflow.flowsources.Remote
|
||||
|
||||
class MainMethod extends Method {
|
||||
MainMethod() {
|
||||
this.hasName("Main") and
|
||||
this.isStatic() and
|
||||
(this.getReturnType() instanceof VoidType or this.getReturnType() instanceof IntType) and
|
||||
if this.getNumberOfParameters() = 1
|
||||
then this.getParameter(0).getType().(ArrayType).getElementType() instanceof StringType
|
||||
else this.getNumberOfParameters() = 0
|
||||
}
|
||||
}
|
||||
import semmle.code.csharp.commons.Util
|
||||
|
||||
/**
|
||||
* A taint-tracking configuration for untrusted user input used to load a DLL.
|
||||
|
||||
@@ -4,14 +4,11 @@
|
||||
* @kind path-problem
|
||||
* @id cs/insecure-sql-connection
|
||||
* @problem.severity error
|
||||
* @precision medium
|
||||
* @tags security
|
||||
* external/cwe/cwe-327
|
||||
*/
|
||||
|
||||
/*
|
||||
* consider: @precision high
|
||||
*/
|
||||
|
||||
import csharp
|
||||
import DataFlow::PathGraph
|
||||
|
||||
|
||||
@@ -947,6 +947,10 @@ class ConvertInstruction extends UnaryInstruction {
|
||||
ConvertInstruction() { getOpcode() instanceof Opcode::Convert }
|
||||
}
|
||||
|
||||
class CheckedConvertOrNullInstruction extends UnaryInstruction {
|
||||
CheckedConvertOrNullInstruction() { getOpcode() instanceof Opcode::CheckedConvertOrNull }
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an instruction that converts between two addresses
|
||||
* related by inheritance.
|
||||
@@ -987,7 +991,7 @@ class InheritanceConversionInstruction extends UnaryInstruction {
|
||||
|
||||
/**
|
||||
* Represents an instruction that converts from the address of a derived class
|
||||
* to the address of a direct non-virtual base class.
|
||||
* to the address of a base class.
|
||||
*/
|
||||
class ConvertToBaseInstruction extends InheritanceConversionInstruction {
|
||||
ConvertToBaseInstruction() { getOpcode() instanceof ConvertToBaseOpcode }
|
||||
|
||||
@@ -947,6 +947,10 @@ class ConvertInstruction extends UnaryInstruction {
|
||||
ConvertInstruction() { getOpcode() instanceof Opcode::Convert }
|
||||
}
|
||||
|
||||
class CheckedConvertOrNullInstruction extends UnaryInstruction {
|
||||
CheckedConvertOrNullInstruction() { getOpcode() instanceof Opcode::CheckedConvertOrNull }
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an instruction that converts between two addresses
|
||||
* related by inheritance.
|
||||
@@ -987,7 +991,7 @@ class InheritanceConversionInstruction extends UnaryInstruction {
|
||||
|
||||
/**
|
||||
* Represents an instruction that converts from the address of a derived class
|
||||
* to the address of a direct non-virtual base class.
|
||||
* to the address of a base class.
|
||||
*/
|
||||
class ConvertToBaseInstruction extends InheritanceConversionInstruction {
|
||||
ConvertToBaseInstruction() { getOpcode() instanceof ConvertToBaseOpcode }
|
||||
|
||||
Reference in New Issue
Block a user