Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

No regeneration of secret when a valid token is submitted #188

Closed
ptantiku opened this issue Jun 23, 2019 · 2 comments
Closed

No regeneration of secret when a valid token is submitted #188

ptantiku opened this issue Jun 23, 2019 · 2 comments

Comments

@ptantiku
Copy link

I found that this module only checks whether the submitted CSRF token is valid against the secret inside session/cookie secret at this line https://github.com/expressjs/csurf/blob/master/index.js#L111.

However, when a correct token is submitted, and it is verified, the code does nothing to the secret. So, I can reuse the same token over-and-over again because the secret does not change.

What it should do is when a valid token is verified, it should regenerate a new secret.

@dougwilson
Copy link
Contributor

That's as it is currently designed. Issues #120 is tracking making expiring ones, and a pull request to implement is welcome!

@dougwilson
Copy link
Contributor

Pull requests to implement the feature you want are welcome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants