[Python] Select existing path node (with flow state) in the isAdditionalFlowState predicate #18853
Replies: 2 comments
-
I have the same question! |
Beta Was this translation helpful? Give feedback.
-
You cannot inspect flow to both
Note that you cannot expect the out-of-the-box analysis to distinguish |
Beta Was this translation helpful? Give feedback.
-
I am trying to track how many times the
get
operation is performed on the return object. However, my current CodeQL query is unable to correctly distinguish between different numbers of get operations.The functions below demonstrate my expected flow states:
Expected Taint Flows:
test1
:SourceKeyFlowState
→ObjectFlowState-MoreThanOne
test2
:SourceKeyFlowState
→ObjectFlowState-One
However, my current CodeQL query does not correctly distinguish between these cases and instead selects all possible four flows.
I think the key problem here is that in the
isAdditionalFlowStep
predicate, I cannot select the path node beside thefromNode
andtoNode
, and use its flow state information to determine the flow state oftoNode
. In my case, the taint propagation step should take into account both the flow state of the key (fromNode
) and the flow state of the base object to correctly determine the flow state oftoNode
.Could anyone provide suggestions on how to fix this issue? Any insights would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions