Rust: Additional test cases for rust/weak-sensitive-data-hashing#22009
Open
geoffw0 wants to merge 4 commits into
Open
Rust: Additional test cases for rust/weak-sensitive-data-hashing#22009geoffw0 wants to merge 4 commits into
geoffw0 wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds additional Rust query-test coverage for rust/weak-sensitive-data-hashing, based on recent DCA observations, and introduces a companion test run for the queries/summary/CryptographicOperations.ql summary query to validate the new/updated expectations in the same fixture.
Changes:
- Expanded
WeakSensitiveDataHashingtest source with additional “near-miss” crypto API patterns (including local types named like algorithms and indirect hashing via a helper). - Updated inline expectations in
test.rsto also assertrust/summary/cryptographic-operationsresults for relevant calls/constructors. - Added a new
CryptographicOperations.qlref+ expected output to run the summary query against the same test file.
Show a summary per file
| File | Description |
|---|---|
| rust/ql/test/query-tests/security/CWE-327/WeakSensitiveDataHashing/test.rs | Adds new crypto-related test scenarios and updates inline expectations for both the security query and the summary query. |
| rust/ql/test/query-tests/security/CWE-327/WeakSensitiveDataHashing/WeakSensitiveDataHashing.expected | Updates expected output to account for the newly-added indirect MD5 hashing case (generated test output update). |
| rust/ql/test/query-tests/security/CWE-327/WeakSensitiveDataHashing/CryptographicOperations.qlref | Adds a new qlref to run the CryptographicOperations summary query with inline expectations postprocessing. |
| rust/ql/test/query-tests/security/CWE-327/WeakSensitiveDataHashing/CryptographicOperations.expected | Adds expected output for the CryptographicOperations summary query (generated test output addition). |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 2
| } | ||
|
|
||
| impl Seed { | ||
| fn new(seed_value: u64) -> Self { |
Comment on lines
+174
to
+175
| // this will be misrecognized as a use of the SEED algorithm, but being a strong | ||
| // algorithm and not sensitive data, there is no query result anyway. |
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.
Additional test cases for
rust/weak-sensitive-data-hashing, based on investigation of some recent new results on DCA. There's a missing result (improvements possible here), and some near misses for false positive query results, but no actual false positive query results.