mirror of
https://github.com/github/codeql.git
synced 2026-01-29 22:32:58 +01:00
get rid of AuthCookieNameConfiguration
This commit is contained in:
@@ -38,6 +38,10 @@ class HttpOnlyCookieTrackingConfiguration extends TaintTracking::Configuration {
|
||||
exists(DataFlow::Node rhs |
|
||||
rhs = getValueForFieldWrite(sl, "HttpOnly") and
|
||||
rhs.getAPredecessor*().asExpr().getBoolValue() = false
|
||||
) and
|
||||
exists(DataFlow::Node rhs |
|
||||
rhs = getValueForFieldWrite(sl, "Name") and
|
||||
isAuthVariable(rhs.getAPredecessor*().asExpr())
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -72,26 +76,6 @@ predicate isAuthVariable(Expr expr) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracks if a variable with a sensitive name is used as a cookie name.
|
||||
*/
|
||||
class AuthCookieNameConfiguration extends TaintTracking::Configuration {
|
||||
AuthCookieNameConfiguration() { this = "AuthCookieNameConfiguration" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
exists(StructLit sl |
|
||||
source.asExpr() = sl and
|
||||
sl.getType().hasQualifiedName("net/http", "Cookie") and
|
||||
exists(DataFlow::Node rhs |
|
||||
rhs = getValueForFieldWrite(sl, "Name") and
|
||||
isAuthVariable(rhs.getAPredecessor*().asExpr())
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) { sink instanceof SetCookieSink }
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracks from gorilla cookie store creation to session save.
|
||||
*/
|
||||
|
||||
@@ -17,11 +17,9 @@ import AuthCookie
|
||||
|
||||
predicate isNetHttpCookieFlow(Expr expr) {
|
||||
exists(
|
||||
HttpOnlyCookieTrackingConfiguration httpOnlyCfg, AuthCookieNameConfiguration cookieNameCfg,
|
||||
SetCookieSink sink, DataFlow::Node source
|
||||
HttpOnlyCookieTrackingConfiguration httpOnlyCfg, DataFlow::Node source, SetCookieSink sink
|
||||
|
|
||||
httpOnlyCfg.hasFlow(source, sink) and
|
||||
cookieNameCfg.hasFlow(source, sink) and
|
||||
sink.asExpr() = expr
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user