File tree Expand file tree Collapse file tree 11 files changed +268
-14
lines changed
src/experimental/query-tests/Security/CWE/CWE-409
test/experimental/query-tests/Security/CWE/CWE-409 Expand file tree Collapse file tree 11 files changed +268
-14
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import cpp
6
6
import semmle.code.cpp.ir.dataflow.TaintTracking
7
- import semmle.code.cpp.security.FlowSources
8
7
import semmle.code.cpp.commons.File
9
8
import DecompressionBomb
10
9
Original file line number Diff line number Diff line change 4
4
5
5
import cpp
6
6
import semmle.code.cpp.ir.dataflow.TaintTracking
7
- import semmle.code.cpp.security.FlowSources
8
- import semmle.code.cpp.commons.File
9
7
import DecompressionBomb
10
8
11
9
/**
12
- * The `BZ2_bzDecompress` function as a Flow source
10
+ * The `BZ2_bzDecompress` function is used in flow sink
13
11
*/
14
12
class BZ2BzDecompressFunction extends DecompressionFunction {
15
13
BZ2BzDecompressFunction ( ) { this .hasGlobalName ( [ "BZ2_bzDecompress" ] ) }
Original file line number Diff line number Diff line change 4
4
5
5
import cpp
6
6
import semmle.code.cpp.ir.dataflow.TaintTracking
7
- import semmle.code.cpp.security.FlowSources
8
7
import DecompressionBomb
9
8
10
9
/**
@@ -18,3 +17,17 @@ class Archive_read_data_block extends DecompressionFunction {
18
17
19
18
override int getArchiveParameterIndex ( ) { result = 0 }
20
19
}
20
+
21
+ /**
22
+ * The `archive_read_open_filename` function as a flow step.
23
+ */
24
+ class ReadOpenFunction extends DecompressionFlowStep {
25
+ ReadOpenFunction ( ) { this .hasGlobalName ( "archive_read_open_filename" ) }
26
+
27
+ override predicate isAdditionalFlowStep ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
28
+ exists ( FunctionCall fc | fc .getTarget ( ) = this |
29
+ node1 .asIndirectExpr ( ) = fc .getArgument ( 1 ) and
30
+ node2 .asIndirectExpr ( ) = fc .getArgument ( 0 )
31
+ )
32
+ }
33
+ }
Original file line number Diff line number Diff line change 4
4
5
5
import cpp
6
6
import semmle.code.cpp.ir.dataflow.TaintTracking
7
- import semmle.code.cpp.security.FlowSources
8
7
import DecompressionBomb
9
8
10
9
/**
@@ -18,7 +17,7 @@ class Mz_zip_entry extends DecompressionFunction {
18
17
}
19
18
20
19
/**
21
- * The `mz_zip_reader_entry_*` and `mz_zip_reader_save_all` functions are used in flow source .
20
+ * The `mz_zip_reader_entry_*` and `mz_zip_reader_save_all` functions are used in flow sink .
22
21
* [docuemnt](https://github.com/zlib-ng/minizip-ng/blob/master/doc/mz_zip_rw.md)
23
22
*/
24
23
class Mz_zip_reader_entry extends DecompressionFunction {
@@ -42,7 +41,7 @@ class UnzOpenFunction extends DecompressionFunction {
42
41
}
43
42
44
43
/**
45
- * The `mz_zip_reader_open_file` and `mz_zip_reader_open_file_in_memory` functions as a flow source .
44
+ * The `mz_zip_reader_open_file` and `mz_zip_reader_open_file_in_memory` functions as a flow step .
46
45
*/
47
46
class ReaderOpenFunction extends DecompressionFlowStep {
48
47
ReaderOpenFunction ( ) {
Original file line number Diff line number Diff line change 4
4
5
5
import cpp
6
6
import semmle.code.cpp.ir.dataflow.TaintTracking
7
- import semmle.code.cpp.security.FlowSources
8
7
import DecompressionBomb
9
8
10
9
/**
Original file line number Diff line number Diff line change 4
4
5
5
import cpp
6
6
import semmle.code.cpp.ir.dataflow.TaintTracking
7
- import semmle.code.cpp.security.FlowSources
8
- import semmle.code.cpp.commons.File
9
7
import DecompressionBomb
10
8
11
9
/**
Original file line number Diff line number Diff line change 4
4
5
5
import cpp
6
6
import semmle.code.cpp.ir.dataflow.TaintTracking
7
- import semmle.code.cpp.security.FlowSources
8
7
import DecompressionBomb
9
8
10
9
/**
Original file line number Diff line number Diff line change 4
4
5
5
import cpp
6
6
import semmle.code.cpp.ir.dataflow.TaintTracking
7
- import semmle.code.cpp.security.FlowSources
8
7
import DecompressionBomb
9
8
10
9
/**
Original file line number Diff line number Diff line change 4
4
5
5
import cpp
6
6
import semmle.code.cpp.ir.dataflow.TaintTracking
7
- import semmle.code.cpp.security.FlowSources
8
7
import DecompressionBomb
9
8
10
9
/**
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments