Skip to content

Commit b813c13

Browse files
Restrict sinks to fix performance
1 parent 7d5388f commit b813c13

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

csharp/ql/lib/semmle/code/csharp/security/auth/SecureCookies.qll

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import csharp
6+
private import semmle.code.csharp.frameworks.system.Web
67
private import semmle.code.csharp.frameworks.microsoft.AspNetCore
78

89
/**
@@ -32,7 +33,15 @@ private module AuthCookieNameConfig implements DataFlow::ConfigSig {
3233

3334
predicate isSource(DataFlow::Node source) { isAuthVariable(source.asExpr()) }
3435

35-
predicate isSink(DataFlow::Node sink) { exists(Call c | sink.asExpr() = c.getAnArgument()) }
36+
predicate isSink(DataFlow::Node sink) {
37+
exists(Call c |
38+
sink.asExpr() = c.getAnArgument() and
39+
(
40+
c.getTarget() = any(MicrosoftAspNetCoreHttpResponseCookies cls).getAppendMethod() or
41+
c.(ObjectCreation).getType() instanceof SystemWebHttpCookie
42+
)
43+
)
44+
}
3645
}
3746

3847
/**

0 commit comments

Comments
 (0)