CVE-2020-5224: Django user sessions Session Key Exposure Through Session Vulnerability
MODERATECVE-2020-5224 is a MODERATE (CVSS 6.5) session key exposure through session vulnerability (CWE-287: Improper Authentication) affecting Django user sessions libraries in the PyPI ecosystem. The issue involves session key exposure through session list in django user sessions. Remediation is available by upgrading affected packages to version 1.7.1.
CVE-2020-5224 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:L/A:N).
How to Fix CVE-2020-5224
To remediate this vulnerability, upgrade all affected Django user sessions dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install django-user-sessions>=1.7.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show django-user-sessions
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2020-5224, inspect your installed packages using pip:
pip show django-user-sessions
Analyze the terminal output to locate any version of Django user sessions in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.1), your application is affected.
Note: The pip show django-user-sessions command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Django user sessions, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-5224 Affected Django user sessions Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
django-user-sessions
|
PyPI |
< 1.7.1
|
1.7.1
|
References
Frequently Asked Questions
What is CVE-2020-5224?
Which Django user sessions versions are affected?
What version fixes CVE-2020-5224?
Is django-user-sessions affected?
What is the CVSS score of CVE-2020-5224?
What CWE is associated with CVE-2020-5224?
How can I check PyPI dependencies for CVE-2020-5224?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5fq8-3q2f-4m5g",
"modified" : "2024-09-16T21:59:21Z",
"published" : "2020-01-24T19:56:59Z",
"aliases" : [ "CVE-2020-5224" ],
"summary" : "Session key exposure through session list in Django User Sessions",
"details" : "### Impact\nThe views provided by django-user-sessions allow users to terminate specific sessions. The session key is used to identify sessions, and thus included in the rendered HTML. In itself this is not a problem. However if the website has an XSS vulnerability, the session key could be extracted by the attacker and a session takeover could happen.\n\n### Patches\nPatch is under way.\n\n### Workarounds\nRemove the session_key from the template.\n\n### References\n_None._\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Bouke/django-user-sessions](https://github.com/Bouke/django-user-sessions/issues)\n* Email us at [bouke@haarsma.eu](mailto:bouke@haarsma.eu)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:N/VA:N/SC:H/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "django-user-sessions"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.7.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Bouke/django-user-sessions/security/advisories/GHSA-5fq8-3q2f-4m5g"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5224"
}, {
"type" : "WEB",
"url" : "https://github.com/jazzband/django-user-sessions/commit/f0c4077e7d1436ba6d721af85cee89222ca5d2d9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Bouke/django-user-sessions"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django-user-sessions/PYSEC-2020-230.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-01-24T19:56:37Z",
"nvd_published_at" : null
}
}