Opened 5 years ago

Last modified 8 months ago

#16859 new Cleanup/optimization

CSRF Improvements

Reported by: PaulM Owned by: PaulM
Component: CSRF Version: master
Severity: Normal Keywords:
Cc: cmawebsite@…, mail@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


This is a ticket to keep track of general CSRF improvements we want to add to Django.

This includes:

  • #16010 - add Origin checking
  • Optionally tie CSRF to sessions
  • Use signing to improve CSRF (maybe with sessions)
  • Improve domain/host checking - deal with the subdomain to subdomain problem

Change History (5)

comment:1 Changed 2 years ago by Japneet Singh

This ticket requires some cleanup and some makeover.Optional tie setup may work or may may not as it has some vulnerabilities.I would kike to add that we build a basic framework for these things to happen.

comment:2 Changed 17 months ago by collinanderson

  • Cc cmawebsite@… added

comment:3 Changed 15 months ago by auvipy

  • Version changed from 1.3 to master

comment:4 Changed 8 months ago by raphaelm

In case other people at the #duth sprint are looking into this: Shai Berger is working on a new approach to generating the tokens and I'm working on the usage of sessions for token storage.

Last edited 8 months ago by raphaelm (previous) (diff)

comment:5 Changed 8 months ago by raphaelm

  • Cc mail@… added

I submitted a first version of a patch for session storage of CSRF tokens:

I'd love to have some review on this, but I'm fine with postponing the merge after Shai landed his changes to CSRF handling, as those two will get merge conflicts and his one will be the bigger change.

Note: See TracTickets for help on using tickets.
Back to Top