-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Swift: mass-enable diff-informed queries phase 2 - getASelected{Source,Sink}Location() { none() }
#19761
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 mass-enables diff-informed incremental mode for Swift security queries by adding a new predicate and stubbing out location selection where only one side is used.
- Added
observeDiffInformedIncrementalMode()
predicate to all Swift security query config modules. - Introduced
getASelectedSourceLocation(...) { none() }
overrides in queries that only select sources.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
swift/ql/lib/codeql/swift/security/regex/RegexInjectionQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/XXEQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/WeakSensitiveDataHashingQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/WeakPasswordHashingQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/UnsafeUnpackQuery.qll | Add observeDiffInformedIncrementalMode and getASelectedSourceLocation |
swift/ql/lib/codeql/swift/security/UnsafeJsEvalQuery.qll | Add observeDiffInformedIncrementalMode and getASelectedSourceLocation |
swift/ql/lib/codeql/swift/security/UncontrolledFormatStringQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/StringLengthConflationQuery.qll | Add observeDiffInformedIncrementalMode and getASelectedSourceLocation |
swift/ql/lib/codeql/swift/security/StaticInitializationVectorQuery.qll | Add observeDiffInformedIncrementalMode and getASelectedSourceLocation |
swift/ql/lib/codeql/swift/security/SqlInjectionQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/PredicateInjectionQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/PathInjectionQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/InsufficientHashIterationsQuery.qll | Add observeDiffInformedIncrementalMode and getASelectedSourceLocation |
swift/ql/lib/codeql/swift/security/HardcodedEncryptionKeyQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/ECBEncryptionQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/ConstantSaltQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/ConstantPasswordQuery.qll | Add observeDiffInformedIncrementalMode and getASelectedSourceLocation |
swift/ql/lib/codeql/swift/security/CommandInjectionQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/CleartextTransmissionQuery.qll | Add observeDiffInformedIncrementalMode |
swift/ql/lib/codeql/swift/security/CleartextLoggingQuery.qll | Add observeDiffInformedIncrementalMode |
Comments suppressed due to low confidence (3)
swift/ql/lib/codeql/swift/security/RegexInjectionQuery.qll:26
- The same
observeDiffInformedIncrementalMode
stub is duplicated across multiple modules; consider extracting this into a shared trait or base config to reduce repetition and simplify future updates.
predicate observeDiffInformedIncrementalMode() { any() }
swift/ql/lib/codeql/swift/security/regex/RegexInjectionQuery.qll:26
- Add dedicated tests for
observeDiffInformedIncrementalMode()
to verify that diff-informed incremental flows are correctly activated and that existing queries still produce expected results.
predicate observeDiffInformedIncrementalMode() { any() }
swift/ql/lib/codeql/swift/security/UnsafeUnpackQuery.qll:30
- [nitpick] You've overridden
getASelectedSourceLocation
but notgetASelectedSinkLocation
. If this query selects only sources or only sinks, ensure the complementary override is present to avoid unintended default location selection.
Location getASelectedSourceLocation(DataFlow::Node sink) { none() }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused as to why we didn't merge https://github.com/github/codeql/pull/19662/files first, but LGTM.
7e4c0c4
to
67bccc3
Compare
Stacks on top of earlier PR: #19659
Uses patch from: https://github.com/github/codeql-patch/pull/88/commits/ec5681e740c18c792443099fb3e413446616a0ee
Adds
getASelected{Source,Sink}Location() { none() }
override to queries that select a dataflow source or sink as a location, but not both.