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

Best approach if is required use multiple html forms in a template #19

Open
chespinoza opened this issue Nov 8, 2014 · 3 comments
Open

Comments

@chespinoza
Copy link

I came across the same situation here:
http://stackoverflow.com/questions/26818516/processing-multiple-forms-from-an-only-template

And I'm wondering if use an only token for several POST requests might work, and if is secure enough?

@chespinoza chespinoza changed the title Best approach if is required use several forms in a template Best approach if is required use multiple html forms in a template Nov 8, 2014
@justinas
Copy link
Owner

justinas commented Nov 9, 2014

As I understand it, the BREACH attack works when the same secret is sent across many requests. I don't think including the same token several times on one page should influence this, as the token is still randomized per request. Though a word from someone more familiar with the internals of BREACH would be more ensuring.

@elithrar
Copy link
Contributor

elithrar commented Nov 9, 2014

Multiple, identical tokens can be more easily identified in a compressed
response due to the way compression works (i.e. go back N bytes for X
length). I'm not sure there's an easy to way to deal with this across
multiple forms though - the better solution may be to provide one token
shared across all forms on the page, and/or reconsider your UX/UI (multiple
forms on a page - what for?). Stuff like search forms (a GET request) don't
need CSRF tokens either.

On Sun Nov 09 2014 at 3:41:13 PM Justinas Stankevičius <
notifications@github.com> wrote:

As I understand it, the BREACH attack works when the same secret is sent
across many requests. I don't think including the same token several times
on one page should influence this, as the token is still randomized per
request. Though a word from someone more familiar with the internals of
BREACH would be more ensuring.


Reply to this email directly or view it on GitHub
#19 (comment).

@justinas
Copy link
Owner

Ok, my wording was a bit off. Repeating the same token on a page does have influence, but capturing one request is not enough to recover it. Nosurf's approach should still be viable – no token is repeated twice.

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

No branches or pull requests

3 participants