File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
python/ql/src/experimental Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import semmle.python.dataflow.new.TaintTracking
17
17
import semmle.python.ApiGraphs
18
18
import semmle.python.dataflow.new.RemoteFlowSources
19
19
import semmle.python.dataflow.new.internal.DataFlowPublic
20
- import DecompressionBomb
20
+ import experimental.semmle.python.security. DecompressionBomb
21
21
22
22
/**
23
23
* `io.TextIOWrapper(ip, encoding='utf-8')` like following:
@@ -90,16 +90,18 @@ module FileAndFormRemoteFlowSource {
90
90
91
91
module BombsConfig implements DataFlow:: ConfigSig {
92
92
predicate isSource ( DataFlow:: Node source ) {
93
- source instanceof RemoteFlowSource and
94
- // or
95
- // source instanceof FileAndFormRemoteFlowSource::FastAPI
96
- exists ( source .getLocation ( ) .getFile ( ) .getRelativePath ( ) ) and
93
+ (
94
+ source instanceof RemoteFlowSource
95
+ or
96
+ source instanceof FileAndFormRemoteFlowSource:: FastAPI
97
+ ) and
98
+ not source .getLocation ( ) .getFile ( ) .inStdlib ( ) and
97
99
not source .getLocation ( ) .getFile ( ) .getRelativePath ( ) .matches ( "%venv%" )
98
100
}
99
101
100
102
predicate isSink ( DataFlow:: Node sink ) {
101
103
sink instanceof DecompressionBomb:: Sink and
102
- exists ( sink .getLocation ( ) .getFile ( ) .getRelativePath ( ) ) and
104
+ not sink .getLocation ( ) .getFile ( ) .inStdlib ( ) and
103
105
not sink .getLocation ( ) .getFile ( ) .getRelativePath ( ) .matches ( "%venv%" )
104
106
}
105
107
File renamed without changes.
You can’t perform that action at this time.
0 commit comments