Skip to content

Commit 318694c

Browse files
committed
Python: Don't rely on d = d.getOutput() for Decoding
Although it is for `json.loads` and the like.
1 parent 5971142 commit 318694c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/ql/src/experimental/semmle/python/security/injection/NoSQLInjection.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class RFSToDictConfig extends TaintTracking::Configuration {
1717
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
1818

1919
override predicate isSink(DataFlow::Node sink) {
20-
exists(Decoding decoding | decoding.getFormat() = "JSON" and sink = decoding)
20+
exists(Decoding decoding | decoding.getFormat() = "JSON" and sink = decoding.getOutput())
2121
}
2222

2323
override predicate isSanitizer(DataFlow::Node sanitizer) {
@@ -32,7 +32,7 @@ class FromDataDictToSink extends TaintTracking2::Configuration {
3232
FromDataDictToSink() { this = "FromDataDictToSink" }
3333

3434
override predicate isSource(DataFlow::Node source) {
35-
exists(Decoding decoding | decoding.getFormat() = "JSON" and source = decoding)
35+
exists(Decoding decoding | decoding.getFormat() = "JSON" and source = decoding.getOutput())
3636
}
3737

3838
override predicate isSink(DataFlow::Node sink) { sink = any(NoSQLQuery noSQLQuery).getQuery() }

0 commit comments

Comments
 (0)