C++: Recognize password struct fields. #7802
Merged
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.
This is an enhancement to
cpp/cleartext-transmission
that allows it to spot passwords that are struct or class fields (much more reliably). I've weeded out a lot of false positive results in previous PRs, but I wanted to address one of the causes of missing results so that we don't just end up having very few results overall.Note that the
SensitiveNode
isn't a perfect implementation; it tries to avoid matching all accesses to aSensitiveVariable
to reduce duplicate results where a variable is accessed multiple times, but this is not done in an especially principled or reliable manner. Happy to take suggestions on how to pick the rightNode
better.New results: https://lgtm.com/query/6627472974229539370/
All results: https://lgtm.com/query/7344851133823789124/