Skip to content

Python: mass enable diff-informed data flow none() location overrides #19797

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

d10c
Copy link
Contributor

@d10c d10c commented Jun 17, 2025

An auto-generated patch that enables diff-informed data flow in the obvious cases.

Adds getASelected{Source,Sink}Location() { none() } override to queries that select a dataflow source or sink as a location, but not both.

An auto-generated patch that enables diff-informed data flow in the obvious cases.

Builds on github#18346 and github/codeql-patch#88
@d10c d10c added the no-change-note-required This PR does not need a change note label Jun 17, 2025
@d10c d10c marked this pull request as ready for review June 17, 2025 14:34
@Copilot Copilot AI review requested due to automatic review settings June 17, 2025 14:34
@d10c d10c requested a review from a team as a code owner June 17, 2025 14:34
@d10c d10c requested a review from michaelnebel June 17, 2025 14:34
Copy link
Contributor

@Copilot Copilot AI left a 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 enables diff-informed data flow in several experimental Python security queries by adding getASelectedSourceLocation(...) { none() } overrides where only source or sink locations are selected.

  • Introduces an empty override for source location in diff-informed incremental mode.
  • Applies the override consistently across four security analysis modules.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
python/ql/src/experimental/semmle/python/security/LdapInsecureAuth.qll Added getASelectedSourceLocation override
python/ql/src/experimental/Security/UnsafeUnpackQuery.qll Added getASelectedSourceLocation override
python/ql/src/experimental/Security/CWE-346/CorsBypass.ql Added getASelectedSourceLocation override
python/ql/src/experimental/Security/CWE-327/Azure/UnsafeUsageOfClientSideEncryptionVersion.ql Added getASelectedSourceLocation override
Comments suppressed due to low confidence (1)

python/ql/src/experimental/semmle/python/security/LdapInsecureAuth.qll:107

  • Consider adding tests to verify that diff-informed incremental mode correctly skips source locations via this override.
  Location getASelectedSourceLocation(DataFlow::Node sink) { none() }

@@ -103,6 +103,8 @@ private module LdapInsecureAuthConfig implements DataFlow::ConfigSig {
}

predicate observeDiffInformedIncrementalMode() { any() }

Location getASelectedSourceLocation(DataFlow::Node sink) { none() }
Copy link
Preview

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This override is identical in multiple config modules; consider extracting a shared mixin or base module to provide the default none() override and reduce duplication.

Copilot uses AI. Check for mistakes.

@d10c
Copy link
Contributor Author

d10c commented Jun 17, 2025

Thanks! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants