Java: Fix Local Temp File/Dir Incorrect Guard Logic#8681
Merged
aschackmull merged 1 commit intogithub:mainfrom Apr 7, 2022
Merged
Java: Fix Local Temp File/Dir Incorrect Guard Logic#8681aschackmull merged 1 commit intogithub:mainfrom
aschackmull merged 1 commit intogithub:mainfrom
Conversation
53622c5 to
e65d4c0
Compare
aschackmull
reviewed
Apr 6, 2022
java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql
Outdated
Show resolved
Hide resolved
aschackmull
reviewed
Apr 6, 2022
| * For example, `taintedFile.getCanonicalFile()` is itself tainted. | ||
| */ | ||
| predicate isAdditionalFileTaintStep(DataFlow::Node node1, DataFlow::Node node2) { | ||
| isFileConstructorArgument(node1.asExpr(), node2.asExpr(), _) or |
Contributor
There was a problem hiding this comment.
Care to comment on this change?
Contributor
Author
There was a problem hiding this comment.
With this, I was having two paths get generated. When rendered, one of the paths wasn't showing the taint step where new File([tainted], [other]) was being called, but the other was. I'm not sure if it's because isAdditionalFileTaintStep is written wrong, or not. But regardless, this line handles the case I was trying to cover anyways:
Contributor
|
Note that |
43cbc35 to
2753521
Compare
aschackmull
approved these changes
Apr 7, 2022
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.
Resolves: #8032 (comment)
Thanks @aschackmull for your feedback and review!