Skip to content
This repository was archived by the owner on Oct 29, 2021. It is now read-only.
This repository was archived by the owner on Oct 29, 2021. It is now read-only.

CSRF gets reset too often causing race condition in browser #71

Open
@roberth

Description

@roberth

When CSRF is enabled, servant-auth-server will set the cookie on every response. The following will happen in the browser with concurrent requests:

  1. Request A is performed by the browser with token=t1
  2. Request B is constructed in JavaScript with token=t1
  3. Response A is received by the browser, sets the cookie to token=t2
  4. Request B gets sent by the browser with t1 in the XSRF header and t2 in the Cookie header
  5. Request B gets rejected even though it is legitimate

This may be more or less of a problem depending on the JavaScript technology used. The context switching by GHCJS probably makes this even more likely than otherwise, but Angular may also suffer from this race condition.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions