Skip to content

Commit

Permalink
[FIX] False positive for insecure cookie attack in case of secure com…
Browse files Browse the repository at this point in the history
…munication (#115)
  • Loading branch information
monu-k2io committed Nov 23, 2023
1 parent 6fe3afd commit 258949e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ private AbstractOperation preprocessSecurityHook(Cookie cookie, String className
return null;
}

SecureCookieOperation operation = new SecureCookieOperation(Boolean.toString(cookie.getSecure()), className, methodName);
boolean isSecure = "https".equals(securityMetaData.getRequest().getProtocol()) || cookie.getSecure();
SecureCookieOperation operation = new SecureCookieOperation(Boolean.toString(isSecure), className, methodName);
operation.setLowSeverityHook(true);
NewRelicSecurity.getAgent().registerOperation(operation);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ private AbstractOperation preprocessSecurityHook(Cookie cookie, String className
return null;
}

SecureCookieOperation operation = new SecureCookieOperation(Boolean.toString(cookie.getSecure()), className, methodName);
boolean isSecure = "https".equals(securityMetaData.getRequest().getProtocol()) || cookie.getSecure();
SecureCookieOperation operation = new SecureCookieOperation(Boolean.toString(isSecure), className, methodName);
operation.setLowSeverityHook(true);
NewRelicSecurity.getAgent().registerOperation(operation);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ private AbstractOperation preprocessSecurityHook(Cookie cookie, String className
return null;
}

SecureCookieOperation operation = new SecureCookieOperation(Boolean.toString(cookie.getSecure()), className, methodName);
boolean isSecure = "https".equals(securityMetaData.getRequest().getProtocol()) || cookie.getSecure();
SecureCookieOperation operation = new SecureCookieOperation(Boolean.toString(isSecure), className, methodName);
operation.setLowSeverityHook(true);
NewRelicSecurity.getAgent().registerOperation(operation);

Expand Down

0 comments on commit 258949e

Please sign in to comment.