Opened 17 years ago

Closed 17 years ago

#5292 closed (fixed)

CsrfMiddleware does not protect from forged POST request with no data

Reported by: Jakub Wilk <django@…> Owned by: Adrian Holovaty
Component: Contrib apps Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django.contrib.csrf.CrsfMiddleware permits any POST request with no data. This is entirely wrong.

Attachments (1)

csrf-empty-post.diff (418 bytes ) - added by Jakub Wilk <django@…> 17 years ago.

Download all attachments as: .zip

Change History (5)

by Jakub Wilk <django@…>, 17 years ago

Attachment: csrf-empty-post.diff added

comment:1 by Simon G. <dev@…>, 17 years ago

Component: UncategorizedContrib apps
Owner: changed from Jacob to Adrian Holovaty
Summary: CrsfMiddleware does not protect from forged POST request with no dataCsrfMiddleware does not protect from forged POST request with no data
Triage Stage: UnreviewedReady for checkin

comment:2 by James Bennett, 17 years ago

Out of curiosity, what's the security impact of a CSRF that doesn't post any data?

comment:3 by Chris Beaven, 17 years ago

A POST request, even an empty one, could potentially be all a view was looking for to do a delete or something.

comment:4 by Adrian Holovaty, 17 years ago

Resolution: fixed
Status: newclosed

(In [6038]) Fixed #5292 -- Changed CSRF middleware to check for request.method == 'POST' instead of request.POST dictionary not being empty. Thanks, Jakub Wilk

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