mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Python: Fix additional taint-steps for cgi
So there isn't flow from *any* instance to *any* access of the methods, but only from the _actual_ instance where the method is accessed.
This commit is contained in:
@@ -1209,14 +1209,21 @@ private module Stdlib {
|
||||
private class AdditionalTaintStep extends TaintTracking::AdditionalTaintStep {
|
||||
override predicate step(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
|
||||
// Methods
|
||||
nodeFrom = instance() and
|
||||
nodeTo in [getvalueRef(), getfirstRef(), getlistRef()]
|
||||
exists(DataFlow::AttrRead read | read = nodeTo and read.getObject() = nodeFrom |
|
||||
nodeFrom = instance() and
|
||||
nodeTo in [getvalueRef(), getfirstRef(), getlistRef()]
|
||||
)
|
||||
or
|
||||
nodeFrom = getvalueRef() and nodeTo = getvalueResult()
|
||||
or
|
||||
nodeFrom = getfirstRef() and nodeTo = getfirstResult()
|
||||
or
|
||||
nodeFrom = getlistRef() and nodeTo = getlistResult()
|
||||
exists(CallNode call |
|
||||
nodeTo.asCfgNode() = call and
|
||||
call.getFunction() = nodeFrom.asCfgNode()
|
||||
|
|
||||
nodeFrom = getvalueRef() and nodeTo = getvalueResult()
|
||||
or
|
||||
nodeFrom = getfirstRef() and nodeTo = getfirstResult()
|
||||
or
|
||||
nodeFrom = getlistRef() and nodeTo = getlistResult()
|
||||
)
|
||||
or
|
||||
// Indexing
|
||||
nodeFrom in [instance(), fieldList()] and
|
||||
|
||||
Reference in New Issue
Block a user