Rust: Correct from model to taint#20529
Merged
geoffw0 merged 4 commits intogithub:mainfrom Sep 26, 2025
Merged
Conversation
…ntional dependence on the taint flow.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Correct the data flow model of the From trait from value to taint in Rust's core library, which exposed an issue with sources in the hard-coded cryptographic value query that was also fixed.
Key changes:
- Changed the flow model for
<_ as core::convert::From>::fromfromvaluetotaint - Fixed array repeat expressions (
[0; 10]) not being recognized as hardcoded cryptographic sources - Updated test expectations to reflect the corrected taint flow behavior
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml | Changed From trait model from value to taint flow |
| rust/ql/lib/codeql/rust/security/HardcodedCryptographicValueExtensions.qll | Added support for array repeat expressions as hardcoded sources |
| rust/ql/test/library-tests/dataflow/strings/main.rs | Updated test comment from hasValueFlow to hasTaintFlow |
| rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected | Updated expected test results for taint flow |
| rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected | Updated expected test results for taint flow |
| rust/ql/test/query-tests/security/CWE-798/HardcodedCryptographicValue.expected | Updated expected test results reflecting array repeat expression support |
paldepind
approved these changes
Sep 26, 2025
Contributor
Author
|
Fixed the merge conflict. |
Contributor
Author
|
Thanks for re-approving. |
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.
Correct the model of
fromfromvaluetotaint.This exposed an issue with the sources for
rust/hard-coded-cryptographic-value, also fixed.I'll do a DCA run to check for other unexpected consequences.