File tree Expand file tree Collapse file tree
python/ql/src/experimental Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import semmle.python.dataflow.new.TaintTracking
1717import semmle.python.ApiGraphs
1818import semmle.python.dataflow.new.RemoteFlowSources
1919import semmle.python.dataflow.new.internal.DataFlowPublic
20- import DecompressionBomb
20+ import experimental.semmle.python.security. DecompressionBomb
2121
2222/**
2323 * `io.TextIOWrapper(ip, encoding='utf-8')` like following:
@@ -90,16 +90,18 @@ module FileAndFormRemoteFlowSource {
9090
9191module BombsConfig implements DataFlow:: ConfigSig {
9292 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
9799 not source .getLocation ( ) .getFile ( ) .getRelativePath ( ) .matches ( "%venv%" )
98100 }
99101
100102 predicate isSink ( DataFlow:: Node sink ) {
101103 sink instanceof DecompressionBomb:: Sink and
102- exists ( sink .getLocation ( ) .getFile ( ) .getRelativePath ( ) ) and
104+ not sink .getLocation ( ) .getFile ( ) .inStdlib ( ) and
103105 not sink .getLocation ( ) .getFile ( ) .getRelativePath ( ) .matches ( "%venv%" )
104106 }
105107
File renamed without changes.
You can’t perform that action at this time.
0 commit comments