#14156 closed (fixed)
CSRF protection in django.contrib.flatpages.views.flatpage causes unwanted behavior
Reported by: | Patryk Zawadzki | Owned by: | nobody |
---|---|---|---|
Component: | Contrib apps | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If you only decorate selected views with csrf_protect
, any non-protected POST that ends up resulting in a 404 response returns 403 Forbidden instead.
This is both unwanted and potentially puzzling to developers. Either the flatpage
view should not be decorated (it seems incapable of altering the application's state) or the above should be documented both in the CSRF section and in the flatpages section.
Change History (3)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 14 years ago
Note:
See TracTickets
for help on using tickets.
(In [13641]) Fixed #14156 -- Modified the way CSRF protection is applied to flatpages so that the flatpage middleware doesn't cause all POSTs resulting in 404s to turn into 403s. Thanks to patrys for the report.