-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Java: Prune PathGraph for CsrfUnprotectedRequestType.ql #20083
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
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 | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -237,12 +237,35 @@ private predicate sink(CallPathNode sinkMethodCall) { | |||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| private predicate fwdFlow(CallPathNode n) { | ||||||||||||||||||||||||||||||||||||
| source(n) | ||||||||||||||||||||||||||||||||||||
| or | ||||||||||||||||||||||||||||||||||||
| exists(CallPathNode mid | fwdFlow(mid) and CallGraph::edges(mid, n)) | ||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
| /** | |
| * Computes backward reachability from sinks within the forward-reachable nodes. | |
| * This predicate implements the bidirectional pruning strategy by combining | |
| * forward reachability (`fwdFlow`) with backward reachability from sinks. | |
| */ |
Copilot
AI
Jul 17, 2025
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 predicate should include documentation about its performance characteristics and the bidirectional pruning strategy, as this is a key optimization that affects query behavior.
| */ | |
| */ | |
| /** | |
| * Holds if `pred` has a successor node `succ` and this edge is in an | |
| * `unprotectedStateChange` path. | |
| * | |
| * Performance characteristics: | |
| * - This predicate relies on `revFlow`, which is a recursive flow predicate | |
| * that combines forward and reverse graph traversal. | |
| * - The use of `CallGraph::edges` ensures that only valid edges in the call | |
| * graph are considered, reducing unnecessary computations. | |
| * | |
| * Bidirectional pruning strategy: | |
| * - The predicate leverages `revFlow(pred)` and `revFlow(succ)` to prune | |
| * the search space by ensuring that both the predecessor and successor | |
| * nodes are part of valid reverse flows. | |
| */ |
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.
Missing documentation for the fwdFlow predicate. Should explain that it computes forward reachability from sources using transitive closure over call graph edges.