File tree Expand file tree Collapse file tree
java/ql/src/experimental/Security/CWE/CWE-1004 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ class SetCookieMethodAccess extends MethodAccess {
4545class SensitiveCookieNameExpr extends Expr {
4646 SensitiveCookieNameExpr ( ) {
4747 exists (
48- ClassInstanceExpr cie , Expr e // new Cookie("jwt_token", token)
48+ ClassInstanceExpr cie // new Cookie("jwt_token", token)
4949 |
5050 (
5151 cie .getConstructor ( ) .getDeclaringType ( ) .hasQualifiedName ( "javax.servlet.http" , "Cookie" ) or
@@ -55,16 +55,14 @@ class SensitiveCookieNameExpr extends Expr {
5555 .hasQualifiedName ( [ "javax.ws.rs.core" , "jakarta.ws.rs.core" ] , "Cookie" )
5656 ) and
5757 this = cie and
58- isSensitiveCookieNameExpr ( e ) and
59- DataFlow:: localExprFlow ( e , cie .getArgument ( 0 ) )
58+ isSensitiveCookieNameExpr ( cie .getArgument ( 0 ) )
6059 )
6160 or
6261 exists (
63- SetCookieMethodAccess ma , Expr e // response.addHeader("Set-Cookie: token=" +authId + ";HttpOnly;Secure")
62+ SetCookieMethodAccess ma // response.addHeader("Set-Cookie: token=" +authId + ";HttpOnly;Secure")
6463 |
6564 this = ma .getArgument ( 1 ) and
66- isSensitiveCookieNameExpr ( e ) and
67- DataFlow:: localExprFlow ( e , ma .getArgument ( 1 ) )
65+ isSensitiveCookieNameExpr ( this )
6866 )
6967 }
7068}
You can’t perform that action at this time.
0 commit comments