-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#: Allow implicit collection reads in sink nodes. #20089
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
base: main
Are you sure you want to change the base?
C#: Allow implicit collection reads in sink nodes. #20089
Conversation
…d additional flow steps) for default taint tracking configurations.
…y accident before as we didn't allow implicit element reads at sinks.
0956459
to
ca5a0dc
Compare
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.
Pull Request Overview
This PR enables implicit collection reads in C# taint tracking sink nodes to improve flow coverage and reduce false negatives. The change allows taint tracking to recognize when tainted elements within a collection can flow to sinks that receive the entire collection.
- Adds implicit collection reads for argument nodes at sinks and flow steps
- Updates default taint tracking configuration to handle collection element flows
- Enhances external model flow detection for collection-based operations
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
TaintTrackingPrivate.qll | Implements the core logic for implicit collection reads at argument nodes |
HashWithoutSalt.ql | Adds collection interface support for CopyTo method detection |
ExternalFlow.expected | Updates test expectations with new flow detection results |
ExternalFlow.cs | Updates test comment to reflect new flow behavior |
CollectionTaintTracking.* | Adds new test cases for collection taint tracking scenarios |
change-notes/* | Documents the analysis improvement |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
node instanceof ArgumentNode and | ||
Collections::isCollectionType(node.getType()) and |
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.
Actually, I would have thought that this was simply exists(node)
.
And additional flow steps (for default taint tracking configurations).
DCA shows a couple of extra alerts, where the added step looks sounds. The alerts show up in various cases where the elements of a collection are tainted and the sink receives the entire collection as input.