Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The change removes integral-expression barriers, causing false-positive cleartext-storage reports, and lacks the required change note for user-visible query changes.
2 open issues
What changed in this PR
Updates C++ cleartext-storage and transmission analysis to track character-based copies and reference values, preparing for the standard-library model changes in #22939.
Changes:
- Shares character-aware barriers and reference-aware source selection between both queries.
- Enables existing character-copy regression expectations.
- Refreshes storage flow paths and reorders transmission expected output.
| File | Description |
|---|---|
cpp/​ql/​test/​query-tests/​Security/​CWE/​CWE-311/​semmle/​tests/​test2.cpp |
Marks the character-copy source and alert as detected. |
cpp/​ql/​test/​query-tests/​Security/​CWE/​CWE-311/​semmle/​tests/​CleartextTransmission.expected |
Reorders result sections without changing results. |
cpp/​ql/​test/​query-tests/​Security/​CWE/​CWE-311/​semmle/​tests/​CleartextFileWrite.expected |
Records character-copy flow and indirect reference sources. |
cpp/​ql/​src/​Security/​CWE/​CWE-311/​CleartextTransmission.ql |
Uses shared source and barrier predicates. |
cpp/​ql/​src/​Security/​CWE/​CWE-311/​CleartextFileWrite.ql |
Uses shared predicates for sensitive-data tracking. |
cpp/​ql/​src/​Security/​CWE/​CWE-311/​ClearText.qll |
Adds shared character-type exclusions and reference-source mapping. |
Review effort: Max (auto)
This branch has not been deployed
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.

The
cpp/cleartext-storage-filequery (and its friendcpp/cleartext-transmission) blocks flow to all integral types in the name of reducing false positives. However, sincecharis an integral type this also blocks common code such as:since the flow is blocked when it reaches the
chvariable. This PR excludeschar-like types from this restriction.As this PR is preparatory for a much larger PR I also included a small related drive-by fix which is necessary for the larger PR. That commit changes the flow so that we select
*x(i.e., the indirection ofx) as the flow source instead ofx(whenxis a variable of reference type). You can see the effect on the subsequent commit which accepts the changes to the path.