mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Merge pull request #12333 from kaspersv/kaspersv/fix-join-order
ReflectedXss: Prevent bad join order
This commit is contained in:
@@ -103,6 +103,12 @@ module ReflectedXss {
|
||||
)
|
||||
}
|
||||
|
||||
bindingset[headerBlock]
|
||||
pragma[inline_late]
|
||||
private predicate doesNotDominateCallback(ReachableBasicBlock headerBlock) {
|
||||
not exists(Expr e | e instanceof Function | headerBlock.dominates(e.getBasicBlock()))
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the HeaderDefinition `header` seems to be local.
|
||||
* A HeaderDefinition is local if it dominates exactly one `ResponseSendArgument`.
|
||||
@@ -122,7 +128,7 @@ module ReflectedXss {
|
||||
header.getBasicBlock().(ReachableBasicBlock).dominates(sender.getBasicBlock())
|
||||
) and
|
||||
// doesn't dominate something that looks like a callback.
|
||||
not exists(Expr e | e instanceof Function | headerBlock.dominates(e.getBasicBlock()))
|
||||
doesNotDominateCallback(headerBlock)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user