File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
java/ql/src/Security/CWE/CWE-614 Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,8 @@ predicate isSafeSecureCookieSetting(Expr e) {
2626 )
2727}
2828
29- class SecureCookieConfiguration extends DataFlow:: Configuration {
30- SecureCookieConfiguration ( ) { this = "SecureCookieConfiguration" }
31-
32- override predicate isSource ( DataFlow:: Node source ) {
29+ private module SecureCookieConfiguration implements DataFlow:: ConfigSig {
30+ predicate isSource ( DataFlow:: Node source ) {
3331 exists ( MethodAccess ma , Method m | ma .getMethod ( ) = m |
3432 m .getDeclaringType ( ) instanceof TypeCookie and
3533 m .getName ( ) = "setSecure" and
@@ -43,14 +41,16 @@ class SecureCookieConfiguration extends DataFlow::Configuration {
4341 )
4442 }
4543
46- override predicate isSink ( DataFlow:: Node sink ) {
44+ predicate isSink ( DataFlow:: Node sink ) {
4745 sink .asExpr ( ) =
4846 any ( MethodAccess add | add .getMethod ( ) instanceof ResponseAddCookieMethod ) .getArgument ( 0 )
4947 }
5048}
5149
50+ module SecureCookieFlow = DataFlow:: Make< SecureCookieConfiguration > ;
51+
5252from MethodAccess add
5353where
5454 add .getMethod ( ) instanceof ResponseAddCookieMethod and
55- not any ( SecureCookieConfiguration df ) . hasFlowToExpr ( add .getArgument ( 0 ) )
55+ not SecureCookieFlow :: hasFlowToExpr ( add .getArgument ( 0 ) )
5656select add , "Cookie is added to response without the 'secure' flag being set."
You can’t perform that action at this time.
0 commit comments