Python: address diff-informed query alert discrepancies#19378
Closed
Python: address diff-informed query alert discrepancies#19378
Conversation
This commit adds expected files for diff-informed testing. These expected files describe how diff-informed queries produce alerts that are not completely in accordance with the given diff ranges.
This commit disabled diff-informed for PolynomialReDoS.ql because it could miss some alerts within diff ranges.
Contributor
There was a problem hiding this comment.
Copilot reviewed 5 out of 25 changed files in this pull request and generated no comments.
Files not reviewed (20)
- python/ql/lib/semmle/python/security/dataflow/PolynomialReDoSQuery.qll: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-104,106-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-111,113-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-119,121-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-141,143-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-166,168-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-175,177-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-18,20-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-200.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-33,35-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-47,49-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-51,53-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-65,67-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-022-UnsafeUnpacking/DIFF-INFORMED/UnsafeUnpack/1-86,88-201.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-327-UnsafeUsageOfClientSideEncryptionVersion/DIFF-INFORMED/UnsafeUsageOfClientSideEncryptionVersion/1-10,12-89.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-327-UnsafeUsageOfClientSideEncryptionVersion/DIFF-INFORMED/UnsafeUsageOfClientSideEncryptionVersion/1-20,22-89.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-327-UnsafeUsageOfClientSideEncryptionVersion/DIFF-INFORMED/UnsafeUsageOfClientSideEncryptionVersion/1-30,32-89.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-327-UnsafeUsageOfClientSideEncryptionVersion/DIFF-INFORMED/UnsafeUsageOfClientSideEncryptionVersion/1-42,44-89.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-327-UnsafeUsageOfClientSideEncryptionVersion/DIFF-INFORMED/UnsafeUsageOfClientSideEncryptionVersion/1-74,76-89.expected: Language not supported
- python/ql/test/experimental/query-tests/Security/CWE-346/DIFF-INFORMED/CorsBypass/1-7,9-17.expected: Language not supported
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.
This PR addresses cases where diff-informed Python queries produce alerts that are not completely in accordance with the given diff ranges.
For queries that incorrectly produce alerts outside the diff ranges, I added expected files so that they can pass QL tests with the
--check-diff-informedflag.For
PolynomialReDoS.ql, which incorrectly omits alerts in the diff ranges, I disabled diff-informed mode until the problem can be addressed.