Skip to content

Commit

Permalink
improve session security by not using secrets to generate the CSRF token
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 10, 2015
1 parent 734c774 commit b2088ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Changes
@@ -1,6 +1,7 @@

6.24 2015-10-09
- Improved session security by not storing secrets in the stash.
6.24 2015-10-10
- Improved session security by not storing secrets in the stash and not using
secrets to generate the CSRF token.
- Improved commands to show all options that can affect their behavior.

6.23 2015-10-06
Expand Down
4 changes: 1 addition & 3 deletions lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -66,9 +66,7 @@ sub _content {
}

sub _csrf_token {
my $c = shift;
$c->session->{csrf_token}
||= sha1_sum $c->app->secrets->[0] . steady_time . rand 999;
shift->session->{csrf_token} ||= sha1_sum $$ . steady_time . rand 999;
}

sub _current_route {
Expand Down

0 comments on commit b2088ea

Please sign in to comment.