Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CSRF is invalid with Stateless CSRF #59065

Closed
@smbpunt

Description

@smbpunt

Symfony version(s) affected

7.2.0

Description

Hi,

After upgrading from Symfony 7.1.6 to 7.2.0 and updating the associated recipes, I encountered a bug when submitting forms: "CSRF token is invalid".

Key Details:

  • Environment: The issue only occurs in the prod environment;
  • CSRF Token Issue: The HTML generated for the CSRF token has a value attribute that is undefined:
<inputtype=“hidden”id=“meeting__token”name=“meeting[_token]”data-controller=“csrf-protection”autocomplete=“off”value=“csrf-token”>

Also, I created a fresh Symfony webapp with a simple CRUD setup. The same issue occurred.

How to reproduce

https://github.com/smbpunt/bug-sf-59065

It's a simple new “webapp” with an entity and an associated crud (all generated via maker-bundle).

  • Clone
  • Install
  • Run server
  • Go to/new
  • Submit a form

Possible Solution

The only working solution/workaround was to comment out thestateless configuration incsrf.yaml :

# Enable stateless CSRF protection for forms and logins/logoutsframework:form:csrf_protection:token_id:submit#    csrf_protection:#        stateless_token_ids:#            - submit#            - authenticate#            - logout

Additional Context

No response

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp