-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Swift: Diff-informed queries: phase 3 (non-trivial locations) #20082
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,10 @@ module InsecureTlsConfig implements DataFlow::ConfigSig { | |
predicate isAdditionalFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) { | ||
any(InsecureTlsExtensionsAdditionalFlowStep s).step(nodeFrom, nodeTo) | ||
} | ||
|
||
predicate observeDiffInformedIncrementalMode() { | ||
none() // query selects some Swift nodes (e.g. "[post] self") that have location file://:0:0:0:0, which always fall outside the diff range. | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you recall if there's any reason we don't give post-update nodes a I may do a quick experiment with this (probably after your PR, to avoid complicating things). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it comes down to the use of UnknownLocation when an AstNode is synthesized. |
||
} | ||
|
||
module InsecureTlsFlow = TaintTracking::Global<InsecureTlsConfig>; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,10 @@ module UnsafeWebViewFetchConfig implements DataFlow::ConfigSig { | |
predicate isAdditionalFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) { | ||
any(UnsafeWebViewFetchAdditionalFlowStep s).step(nodeFrom, nodeTo) | ||
} | ||
|
||
predicate observeDiffInformedIncrementalMode() { | ||
none() // can't override location accurately because of secondary use in select. | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the issue here? The only unusual thing I can see in that query is selecting from three possible alert messages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This issue is the second flow call ( |
||
} | ||
|
||
/** | ||
|
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.
The logic in
getASelectedSinkLocation
is duplicated across CleartextStoragePreferencesQuery.qll and CleartextStorageDatabaseQuery.qll. Consider extracting this common pattern into a shared utility predicate to improve maintainability.Copilot uses AI. Check for mistakes.