Django up to 1.7 URL Parser django.core.urlresolvers.reverse code injection
CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
---|---|---|
4.6 | $0-$5k | 0.00 |
A vulnerability has been found in Django (Content Management System) and classified as problematic. Affected by this vulnerability is the function django.core.urlresolvers.reverse
of the component URL Parser. The manipulation with an unknown input leads to a code injection vulnerability. The CWE definition for the vulnerability is CWE-94. The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. As an impact it is known to affect integrity. The summary by CVE is:
The django.core.urlresolvers.reverse function in Django before 1.4.11, 1.5.x before 1.5.6, 1.6.x before 1.6.3, and 1.7.x before 1.7 beta 2 allows remote attackers to import and execute arbitrary Python modules by leveraging a view that constructs URLs using user input and a "dotted Python path."
The weakness was presented 04/21/2014 by Benjamin Bach as Security releases issued as confirmed advisory (Website). It is possible to read the advisory at djangoproject.com. The public release was coordinated in cooperation with the project team. This vulnerability is known as CVE-2014-0472 since 12/19/2013. The exploitation appears to be easy. The attack can be launched remotely. The exploitation doesn't need any form of authentication. Technical details of the vulnerability are known, but there is no available exploit. The attack technique deployed by this issue is T1059 according to MITRE ATT&CK. The advisory points out:
One argument signature for reverse() is to pass a dotted Python path to the desired view. In this situation, Django will import the module indicated by that dotted path as part of generating the resulting URL. If such a module has import-time side effects, those side effects will occur.
The vulnerability scanner Nessus provides a plugin with the ID 73676 (FreeBSD : django -- multiple vulnerabilities (59e72db2-cae6-11e3-8420-00e0814cab4e)), which helps to determine the existence of the flaw in a target environment. It is assigned to the family FreeBSD Local Security Checks. The commercial vulnerability scanner Qualys is able to test this issue with plugin 167246 (OpenSuSE Security Update for python-django (openSUSE-SU-2014:1132-1)). The advisory illustrates:
Thus it is possible for an attacker to cause unexpected code execution, given the following conditions: 1) One or more views are present which construct a URL based on user input (commonly, a "next" parameter in a querystring indicating where to redirect upon successful completion of an action). 2) One or more modules are known to an attacker to exist on the server's Python import path, which perform code execution with side effects on importing.
Upgrading to version 1.4.11, 1.5.6 or 1.6.3 eliminates this vulnerability. The upgrade is hosted for download at djangoproject.com. A possible mitigation has been published immediately after the disclosure of the vulnerability. The advisory contains the following remark:
To remedy this, reverse() will now only accept and import dotted paths based on the view-containing modules listed in the project's URL pattern configuration, so as to ensure that only modules the developer intended to be imported in this fashion can or will be imported.
The vulnerability is also documented in the databases at X-Force (92705), Tenable (73676), SecurityFocus (BID 67041†), Secunia (SA58201†) and SecurityTracker (ID 1030149†). See VDB-10295, VDB-13065, VDB-13064 and VDB-13240 for similar entries.
Product
Type
Name
Version
License
CPE 2.3
CPE 2.2
CVSSv4
VulDB CVSS-B Score: 🔍VulDB CVSS-BT Score: 🔍
VulDB Vector: 🔍
VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 5.3VulDB Meta Temp Score: 4.6
VulDB Base Score: 5.3
VulDB Temp Score: 4.6
VulDB Vector: 🔍
VulDB Reliability: 🔍
CVSSv2
AV | AC | Au | C | I | A |
---|---|---|---|---|---|
💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
---|---|---|---|---|---|
unlock | unlock | unlock | unlock | unlock | unlock |
unlock | unlock | unlock | unlock | unlock | unlock |
unlock | unlock | unlock | unlock | unlock | unlock |
VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍
NVD Base Score: 🔍
Exploiting
Class: Code injectionCWE: CWE-94 / CWE-74 / CWE-707
CAPEC: 🔍
ATT&CK: 🔍
Local: No
Remote: Yes
Availability: 🔍
Status: Unproven
EPSS Score: 🔍
EPSS Percentile: 🔍
Price Prediction: 🔍
Current Price Estimation: 🔍
0-Day | unlock | unlock | unlock | unlock |
---|---|---|---|---|
Today | unlock | unlock | unlock | unlock |
Nessus ID: 73676
Nessus Name: FreeBSD : django -- multiple vulnerabilities (59e72db2-cae6-11e3-8420-00e0814cab4e)
Nessus File: 🔍
Nessus Risk: 🔍
Nessus Family: 🔍
Nessus Port: 🔍
OpenVAS ID: 702934
OpenVAS Name: Debian Security Advisory DSA 2934-1 (python-django - security update
OpenVAS File: 🔍
OpenVAS Family: 🔍
Qualys ID: 🔍
Qualys Name: 🔍
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: UpgradeStatus: 🔍
Reaction Time: 🔍
0-Day Time: 🔍
Exposure Time: 🔍
Upgrade: Django 1.4.11/1.5.6/1.6.3
Timeline
12/19/2013 🔍04/21/2014 🔍
04/21/2014 🔍
04/21/2014 🔍
04/21/2014 🔍
04/23/2014 🔍
04/23/2014 🔍
04/23/2014 🔍
04/24/2014 🔍
04/24/2014 🔍
04/28/2014 🔍
06/17/2021 🔍
Sources
Advisory: Security releases issuedResearcher: Benjamin Bach
Status: Confirmed
Confirmation: 🔍
Coordinated: 🔍
CVE: CVE-2014-0472 (🔍)
OVAL: 🔍
X-Force: 92705 - Django django.core.urlresolvers.reverse() code execution, High Risk
SecurityFocus: 67041 - Django 'reverse()' Function Arbitrary Code Execution Vulnerability
Secunia: 58201 - Django Security Issue and Multiple Vulnerabilities, Moderately Critical
SecurityTracker: 1030149 - Django Bugs Let Remote Users Execute Arbitrary Code, Modify SQL Queries, and Obtain Potentially Sensitive Information
Vulnerability Center: 44289 - Django Remote Code Execution Vulnerability via django.core.urlresolvers.reverse(), Medium
See also: 🔍
Entry
Created: 04/23/2014 04:59 PMUpdated: 06/17/2021 04:42 PM
Changes: 04/23/2014 04:59 PM (90), 05/26/2017 04:02 AM (6), 06/17/2021 04:42 PM (3)
Complete: 🔍
Cache ID: 18:23D:40
No comments yet. Languages: en.
Please log in to comment.