mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Update InsecureCookie.ql
Support interprocedural setting of cookie security
This commit is contained in:
@@ -26,11 +26,19 @@ predicate isSafeSecureCookieSetting(Expr e) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
from MethodAccess add
|
class SecureCookieConfiguration extends DataFlow::Configuration {
|
||||||
|
SecureCookieConfiguration() { this = "SecureCookieConfiguration" }
|
||||||
|
|
||||||
|
override predicate isSource(DataFlow::Node source) { any() }
|
||||||
|
|
||||||
|
override predicate isSink(DataFlow::Node sink) { any() }
|
||||||
|
}
|
||||||
|
|
||||||
|
from MethodAccess add, SecureCookieConfiguration df
|
||||||
where
|
where
|
||||||
add.getMethod() instanceof ResponseAddCookieMethod and
|
add.getMethod() instanceof ResponseAddCookieMethod and
|
||||||
not exists(Variable cookie, MethodAccess m |
|
not exists(Variable cookie, MethodAccess m |
|
||||||
add.getArgument(0) = cookie.getAnAccess() and
|
df.hasFlow(DataFlow::exprNode(cookie.getAnAccess()), DataFlow::exprNode(add.getArgument(0))) and
|
||||||
m.getMethod().getName() = "setSecure" and
|
m.getMethod().getName() = "setSecure" and
|
||||||
forex(DataFlow::Node argSource |
|
forex(DataFlow::Node argSource |
|
||||||
DataFlow::localFlow(argSource, DataFlow::exprNode(m.getArgument(0))) and
|
DataFlow::localFlow(argSource, DataFlow::exprNode(m.getArgument(0))) and
|
||||||
|
|||||||
Reference in New Issue
Block a user