Skip to content

Migrate to stateless CSRF tokens #982

@marien-probesys

Description

@marien-probesys

Symfony 7.2 introduced the concept of "stateless" CSRF tokens. This system is very appealing, but it comes with two requirements:

  • in production, we must be sure that the Origin and Referer headers are correctly set (because they are probably not forwarded from the reverse proxy)
  • as the CSRF verification requires some JavaScript, we'll probably have to write some code to get the CSRF token

The existing system works well so we have no plan to migrate soon. However, this new system could improve the UX as the users shouldn't face the "The CSRF token is invalid" error anymore.

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    need helpWe'll need help on this subjecttechnical debtThe past will not stop us from moving forward

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions