Controllers performing data modification should make use of CSRF tokens via /session/token

Created on 27 November 2024, 10 months ago

Overview

We have various controllers that perform actions (CUD in CRUD).
To prevent CSRF these should be fetching the CSRF token from /session/token and adding that as an X-CSRF-Token header and then checking that token - see examples in REST module โ†’

Proposed resolution

Update API endpoints in rtk query to fetch token from /session/token and attach it as a custom header.
Check header in any controller that performs data modification

User interface changes

๐Ÿ› Bug report
Status

Active

Version

0.0

Component

Data model

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia larowlan ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ.au GMT+10

Live updates comments and jobs are added and updated live.
  • Security

    It is used for security vulnerabilities which do not need a security advisory. For example, security issues in projects which do not have security advisory coverage, or forward-porting a change already disclosed in a security advisory. See Drupalโ€™s security advisory policy for details. Be careful publicly disclosing security vulnerabilities! Use the โ€œReport a security vulnerabilityโ€ link in the project pageโ€™s sidebar. See how to report a security issue for details.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024