-
Hey, To my understanding of the path injection, the only safe case is when the state of the path goes through the following states:
The problem is within the sanitizer, it contains: // Block `NotNormalized` paths here, since they change state to `NormalizedUnchecked`
node instanceof Path::PathNormalization and state instanceof NotNormalized So that means a The path state |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I'm still interested on understanding this one ... it looks like I am missing a small detail ... can't figure it out. Please let me know if my question is not clear ? |
Beta Was this translation helpful? Give feedback.
-
In the additional taint step, we add an EXTRA edge to the taint-tracking graph to the new state. If there was an existing data-flow/taint-tracking edge to/from the same nodes, we would continue tracking with both states. For example, if there is a general taint-step saying that the output of source # NotNormalized
norm = os.path.abspath(source) # norm is NormalizedUnchecked
if norm.startswith(f"{ROOT}/user_uploads/"):
open(norm) # flow to norm is blocked
else:
open(norm) # unsafe, norm is NormalizedUnchecked |
Beta Was this translation helpful? Give feedback.
In the additional taint step, we add an EXTRA edge to the taint-tracking graph to the new state. If there was an existing data-flow/taint-tracking edge to/from the same nodes, we would continue tracking with both states.
For example, if there is a general taint-step saying that the output of
os.path.abspath
is tainted if the first argument is tainted, in the code below, we would have thatnorm
on the second line would be considered BOTHNormalizedUnchecked
andNotNormalized
, which is obviously wrong.