#24915: Stricter validation on session key
------------------------------------------------+------------------------
Reporter: erikr | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.sessions | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Recently we had a vulnerability where session keys were set to empty
strings: https://www.djangoproject.com/weblog/2015/may/20/security-
release/
I can't really imagine any case where setting empty strings as session
keys is a sensible thing to do. I therefore think we should add some
basic validation on the key. Perhaps we should have a minimum length of
5-8 characters, because it would be just as problematic if it were only
one or two characters. This doesn't make it impossible to have weak
session keys, but it is a very basic hardening that would protect us from
such a bug in the future.
Without having looked at the code, my first idea is that this belongs in
the session backends somewhere. This breaks backwards compatibility, but
given the rationale I think a mention in the release notes is sufficient.
--
Ticket URL: <https://code.djangoproject.com/ticket/24915>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.2a620d3bffca9cfdc0d68f3a940264c9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.