-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix interaction between defaultAdditionalTaintStep and defaultImplicitTaintRead #18776
base: main
Are you sure you want to change the base?
Conversation
@@ -71,7 +71,8 @@ module TaintFlowMake< | |||
Config::isSink(node) or | |||
Config::isSink(node, _) or | |||
Config::isAdditionalFlowStep(node, _, _) or | |||
Config::isAdditionalFlowStep(node, _, _, _, _) | |||
Config::isAdditionalFlowStep(node, _, _, _, _) or | |||
defaultAdditionalTaintStep(node, _, _) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ for the benefit of reviewers, this is the actual change, everything else is consequences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aschackmull does this looks like a reasonable change to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was left out on purpose to avoid lazy/imprecise models. Models from e.g. MaD are expected to handle content precisely without the need for implicit reads. I'm afraid that adding this could yield unintended FP flow in all sorts of places, but I don't know for sure. It's certainly risky, and I wouldn't expect it to be necessary.
Could you elaborate on the motivating example?
let _ = string1 + &string2;
Where's the missing read step - is it from string2
to &string2
or something like that? (please excuse my ignorance of Rust semantics). If so, it would seem that there would be plenty of room to add a proper read step.
defaultImplicitTaintRead
is described as follows:However where we implement the functionality of
defaultImplicitTaintRead
(inallowImplicitRead
, see the first commit), it is only applied at sinks and additional taint steps defined in the configuration. Additional taint steps defined viadefaultAdditionalTaintStep
are overlooked.In Rust, one such
defaultAdditionalTaintStep
is for concatenation with+
, and one suchdefaultImplicitTaintRead
is for reading from reference content. As a result we've been missing flow in common cases like this:This PR is a draft (for now) because I'm nervous of unintended consequences, or whether this interaction was left out on purpose (for performance reasons perhaps). The change is in shared code and may affect all languages.
TODO:
library-tests/TaintedUrlSuffix
are positive, the rest I don't understand (neutral???)