File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
java/ql/src/Security/CWE/CWE-614 Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,18 @@ predicate isSafeSecureCookieSetting(Expr e) {
29
29
class SecureCookieConfiguration extends DataFlow:: Configuration {
30
30
SecureCookieConfiguration ( ) { this = "SecureCookieConfiguration" }
31
31
32
- override predicate isSource ( DataFlow:: Node source ) { any ( ) }
32
+ override predicate isSource ( DataFlow:: Node source ) {
33
+ exists ( Variable cookie , MethodAccess m |
34
+ source .asExpr ( ) = cookie .getAnAccess ( ) and
35
+ cookie .getAnAccess ( ) = m .getQualifier ( ) and
36
+ m .getMethod ( ) .getName ( ) = "setSecure"
37
+ )
38
+ }
33
39
34
- override predicate isSink ( DataFlow:: Node sink ) { any ( ) }
40
+ override predicate isSink ( DataFlow:: Node sink ) {
41
+ sink .asExpr ( ) =
42
+ any ( MethodAccess add | add .getMethod ( ) instanceof ResponseAddCookieMethod ) .getArgument ( 0 )
43
+ }
35
44
}
36
45
37
46
from MethodAccess add , SecureCookieConfiguration df
You can’t perform that action at this time.
0 commit comments