Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make CSRF cookie secure #485

Open
bradcupit opened this issue May 9, 2014 · 1 comment
Open

make CSRF cookie secure #485

bradcupit opened this issue May 9, 2014 · 1 comment
Assignees

Comments

@bradcupit
Copy link
Contributor

See original discussion on the GWTP mailing list.

GWTP's CSRF protection sets a cookie whose value is either the JSESSIONID (see HttpSessionSecurityCookieFilter) or a random number (see RandomSecurityCookieFilter).

This works since attackers can't see cookies in CSRF attacks. However, if the attacker can sniff requests then they can see the cookie value, so it would be nice to mark the cookie secure to prevent sniffing.

Right now there's no easy way to mark either HttpSessionSecurityCookieFilter or RandomSecurityCookieFilter's cookies secure. Two different ideas:

  1. make this configurable via Guice/Spring, or
  2. quick and dirty: detect if the request is secure and if so, make the cookie secure:
if (request.isSecure()) {
  cookie.setSecure(true);
}
@christiangoudreau
Copy link
Member

Sorry for the late acknowledgement, seems fair and useful!

@christiangoudreau christiangoudreau added this to the 1.4 Release milestone Aug 3, 2014
@meriouma meriouma modified the milestones: 1.4 Release, 1.5 Release Jan 24, 2015
@Chris-V Chris-V removed this from the 1.5 Release milestone Sep 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants