Skip to content

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

Merged
d10c merged 1 commit into
github:mainfrom
d10c:d10c/python/diff-informed-2
Jun 19, 2025
Merged

Python: mass enable diff-informed data flow none() location overrides#19797
d10c merged 1 commit into
github:mainfrom
d10c:d10c/python/diff-informed-2

Conversation

@d10c

@d10cd10c commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

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
@d10cd10c 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
CopilotAI review requested due to automatic review settings June 17, 2025 14:34
@d10c
d10c requested a review from a team as a code ownerJune 17, 2025 14:34
@d10c
d10c requested a review from michaelnebelJune 17, 2025 14:34

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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.

FileDescription
python/ql/src/experimental/semmle/python/security/LdapInsecureAuth.qllAdded getASelectedSourceLocation override
python/ql/src/experimental/Security/UnsafeUnpackQuery.qllAdded getASelectedSourceLocation override
python/ql/src/experimental/Security/CWE-346/CorsBypass.qlAdded getASelectedSourceLocation override
python/ql/src/experimental/Security/CWE-327/Azure/UnsafeUsageOfClientSideEncryptionVersion.qlAdded 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() }


predicate observeDiffInformedIncrementalMode() { any() }

Location getASelectedSourceLocation(DataFlow::Node sink) { none() }

CopilotAIJun 17, 2025

Copy link

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

d10c commented Jun 17, 2025

Copy link
Copy Markdown
ContributorAuthor

Thanks! 🚀

@d10c
d10c merged commit 438b92b into github:mainJun 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-requiredThis PR does not need a change notePython

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@d10c@tausbn