Python: Fix hasFlowPath default implementation of isSink/2#2100
Merged
taus-semmle merged 2 commits intogithub:masterfrom Oct 18, 2019
Merged
Python: Fix hasFlowPath default implementation of isSink/2#2100taus-semmle merged 2 commits intogithub:masterfrom
taus-semmle merged 2 commits intogithub:masterfrom
Conversation
Member
Author
|
@taus-semmle I added a testcase to make it more clear what was going on, and to ensure we don't introduce this regression again. For clarity I added it as a separate commit now, but lets squash the commits together before we merge into master 😉 |
If hasFlowPath was used, and isSink/2 was not overridden, hasFlowPath(src, sink) would not use isSink/1 to restrict the allowed TaintSink. This resulted in false-positives when we had flows with unrelated TaintSinks. FP: https://lgtm.com/projects/g/graphite-project/graphite-web/snapshot/1a8e7ffc2eab2210a73f30b03e9cdeb520a02057/files/webapp/graphite/dashboard/views.py#x2d486922081db956:1 Fixes github#2081
c8c9008 to
bf197b9
Compare
Member
Author
|
rebased onto newest master |
taus-semmle
approved these changes
Oct 14, 2019
Contributor
taus-semmle
left a comment
There was a problem hiding this comment.
This looks good to me. As far as I can tell, it was an oversight that this was not included in the first place (cf. the definition of isSource).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If hasFlowPath was used, and isSink/2 was not overridden,
hasFlowPath(src, sink) would not use isSink/1 to restrict the allowed TaintSink.
This resulted in false-positives when we had flows with unrelated TaintSinks.
FP: https://lgtm.com/projects/g/graphite-project/graphite-web/snapshot/1a8e7ffc2eab2210a73f30b03e9cdeb520a02057/files/webapp/graphite/dashboard/views.py#x2d486922081db956:1
Fixes #2081
@taus-semmle I put this as a draft pull request, since I am not 100% sure what the consequences of changing such a fundamental predicate will be. It does resolve the problems in the graphite snapshot, but other than that I have not run tests locally yet