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) {
2929class SecureCookieConfiguration extends DataFlow:: Configuration {
3030 SecureCookieConfiguration ( ) { this = "SecureCookieConfiguration" }
3131
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+ }
3339
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+ }
3544}
3645
3746from MethodAccess add , SecureCookieConfiguration df
You can’t perform that action at this time.
0 commit comments