mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
Restrict Append calls to string arguments
This commit is contained in:
@@ -82,7 +82,8 @@ predicate nonHttpOnlyCookieCall(Call c) {
|
||||
or
|
||||
// IResponseCookies.Append(String, String) was called, `HttpOnly` is set to `false` by default
|
||||
mc = c and
|
||||
mc.getNumberOfArguments() < 3
|
||||
mc.getNumberOfArguments() < 3 and
|
||||
mc.getTarget().getParameter(0).getType() instanceof StringType
|
||||
)
|
||||
)
|
||||
or
|
||||
|
||||
@@ -57,7 +57,8 @@ predicate insecureCookieAppend(Expr sink) {
|
||||
exists(MethodCall mc, MicrosoftAspNetCoreHttpResponseCookies iResponse |
|
||||
mc = sink and
|
||||
iResponse.getAppendMethod() = mc.getTarget() and
|
||||
mc.getNumberOfArguments() < 3
|
||||
mc.getNumberOfArguments() < 3 and
|
||||
mc.getTarget().getParameter(0).getType() instanceof StringType
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user