Skip to content

C++: Add TaintInheritingContent #16063

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

Merged
merged 7 commits into from
Mar 26, 2024

Conversation

MathiasVP
Copy link
Contributor

Many other languages have found this class very useful and in the name of aligning languages we should add it to C/C++ as well.

@MathiasVP MathiasVP requested a review from a team as a code owner March 26, 2024 16:40
@github-actions github-actions bot added the C++ label Mar 26, 2024
Comment on lines +81 to +85
/**
* Object->field flow when the object is of type
* TaintInheritingContentObject and the field is named
* flowFromObject
*/

Check warning

Code scanning / CodeQL

Class QLDoc style.

The QLDoc for a class should start with 'A', 'An', or 'The'.
@@ -37,6 +38,13 @@ predicate localAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeT
)
or
any(Ssa::Indirection ind).isAdditionalTaintStep(nodeFrom, nodeTo)
or
// object->field conflation for content that is a `TaintInheritingContent`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this comment expressed the intended direction, i.e. from qualifier to field in a read of qualifier->field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was indeed what I thought I was communicating with the object->field arrow. But if that's not clear I can make it more explicit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean, for me the word "conflation" suggests a two-way relationship (merging two things into one) which threw me off a bit - but the comment in the TaintInheritingContent class itself is completely clear.

@geoffw0
Copy link
Contributor

geoffw0 commented Mar 26, 2024

I guess a DCA run doesn't make much sense as there are no (default) models that use this at the moment.

@MathiasVP
Copy link
Contributor Author

I guess a DCA run doesn't make much sense as there are no (default) models that use this at the moment.

Totally agree. Once you're happy with this we can merge it. I expect the DIL to be completely identical before and after (since the abstract class is empty).

@MathiasVP MathiasVP merged commit 3e96028 into github:main Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants