-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Rust: Also lift read steps in summaries as taint steps #21122
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
Conversation
| } | ||
|
|
||
| private class ImplicitDerefOutNode extends ImplicitDerefNode, OutNode { | ||
| private DataFlowCall call; |
Check warning
Code scanning / CodeQL
Dead code Warning
| bindingset[derefChain, borrow, strippedTypePath, strippedType] | ||
| private predicate hasNoCompatibleNonBlanketLikeTargetCheck( | ||
| string derefChain, BorrowKind borrow, TypePath strippedTypePath, Type strippedType | ||
| DerefChain derefChain, BorrowKind borrow, TypePath strippedTypePath, Type strippedType |
Check warning
Code scanning / CodeQL
Missing QLDoc for parameter Warning
67a4cff to
c1533de
Compare
c1533de to
209ee92
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 generalizes taint propagation through read steps in Rust data flow analysis. Previously, only element and reference content would propagate taint through all read steps (including flow summaries). Now, all content types participate in taint propagation through read steps, unless explicitly excluded.
Key changes:
- Simplified taint tracking logic to treat all read steps uniformly
- Enables flow summaries to properly participate in taint propagation for all content types
- Fixes previously missing taint flows through operations like
.clone().into_string().unwrap()and.lines().nth(1).unwrap().clone()
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 |
|---|---|
| rust/ql/lib/codeql/rust/dataflow/internal/TaintTrackingImpl.qll | Simplified taint step logic to apply to all read steps rather than just element/reference content |
| rust/ql/test/query-tests/security/CWE-798/HardcodedCryptographicValue.expected | Updated test expectations with new flow summaries (MaD 18-22) for Vec::from conversions |
| rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected | Added new taint edges for PathBuf conversions through field reads |
| rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected | Updated with new String::from flow summaries and renumbered existing models |
| rust/ql/test/library-tests/dataflow/sources/stdin/test.rs | Removed MISSING marker - taint flow now properly detected through .clone() |
| rust/ql/test/library-tests/dataflow/sources/stdin/InlineFlow.expected | Added new edges for clone and nth operations, new models for these operations |
| rust/ql/test/library-tests/dataflow/sources/file/test.rs | Removed MISSING marker - taint flow now detected through .into_string().unwrap() |
| rust/ql/test/library-tests/dataflow/sources/file/InlineFlow.expected | Added new OsString::into_string flow summary |
| rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected | Added new Pin::new flow summary and updated model numbering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
paldepind
left a comment
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.
Nice, thanks!
Does what the title says.
DCA looks good: A good number of new alerts, and no performance regressions.