Skip to content

Commit 9d86e79

Browse files
committed
move library file to experimental lib directory
1 parent 1318afd commit 9d86e79

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

python/ql/src/experimental/Security/CWE-409/DecompressionBombs.ql

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import semmle.python.dataflow.new.TaintTracking
1717
import semmle.python.ApiGraphs
1818
import semmle.python.dataflow.new.RemoteFlowSources
1919
import 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

9191
module 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

0 commit comments

Comments
 (0)