Bug 1221526 (CVE-2015-3982)

Summary: CVE-2015-3982 django: incorrect session flushing in the cached_db backend
Product: [Other] Security Response Reporter: Martin Prpič <mprpic>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Django 1.8.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-14 09:40:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
cached-db-master.patch
none
cached-db-1.8.patch none

Description Martin Prpič 2015-05-14 09:38:27 UTC
The following flaw was found in Django 1.8:

A change to session.flush() in the cached_db session backend in Django 1.8 mistakenly sets the session key to an empty string rather than None. An empty string is treated as a valid session key and the session cookie is set accordingly. Any users with an empty string in their session cookie will use the same session store. session.flush() is called by django.contrib.auth.logout() and, more seriously, by django.contrib.auth.login() when a user switches accounts. If a user is logged in and logs in again to a different account (without logging out) the session is flushed to avoid reuse. After the session is flushed (and its session key becomes '') the account details are set on the session and the session is saved. Any users with an empty string in their session cookie will now be logged into that account.

Acknowledgements:

Red Hat would like to thank the upstream Django project for reporting this issue.

Comment 1 Martin Prpič 2015-05-14 09:39:21 UTC
Created attachment 1025330 [details]
cached-db-master.patch

Comment 2 Martin Prpič 2015-05-14 09:39:43 UTC
Created attachment 1025331 [details]
cached-db-1.8.patch

Comment 3 Martin Prpič 2015-05-14 09:40:50 UTC
Statement:

Not vulnerable. The 1.8 version of Django is not shipped in any Red Hat product.

Comment 4 Martin Prpič 2015-05-22 10:37:30 UTC
External References:

https://www.djangoproject.com/weblog/2015/may/20/security-release/