-
Hi, CodeQL Team! I hope this message finds you well. As shown in the following ql file, no other source, sink, or flow to are set in the overall query.
import python
import semmle.python.security.dataflow.UnsafeDeserializationQuery
import UnsafeDeserializationFlow::PathGraph
from UnsafeDeserializationFlow::PathNode source, UnsafeDeserializationFlow::PathNode sink
where UnsafeDeserializationFlow::flowPath(source, sink)
select sink.getNode(), source, sink, "Unsafe deserialization depends on a $@.", source.getNode(),
"user-provided value"
private module UnsafeDeserializationConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) { source instanceof Source }
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
}
/** Global taint-tracking for detecting "code execution from deserialization" vulnerabilities. */
module UnsafeDeserializationFlow = TaintTracking::Global<UnsafeDeserializationConfig>; Therefore, my confusion is that codeql is the first in the internal process, has the pickle.loads parameter as the sink parameter. If yes, can you tell me about the rule file conveniently ? In addition, what are the default source and sink variables in personal curiosity codeql |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @fe1w0, if you open the file in VS Code with the CodeQL extension installed, you can simply ctrl+click This takes you to the following piece of code: What it means is that:
If you search our code for codeql/python/ql/lib/semmle/python/frameworks/Stdlib.qll Lines 1343 to 1357 in f3b27d6 |
Beta Was this translation helpful? Give feedback.
Hi @fe1w0, if you open the file in VS Code with the CodeQL extension installed, you can simply ctrl+click
Source
to see the definition 😊This takes you to the following piece of code:
codeql/python/ql/lib/semmle/python/security/dataflow/UnsafeDeserializationCustomizations.qll
Lines 19 to 54 in 4bc4e08