Cloudanix VulnDB

CVE-2016-9013

Critical · 9.8

CVSS

9.8

EPSS

5.2%

Published

Dec 9, 2016

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A flaw in the web framework allows an attacker to easily guess the password for a temporary database user created during automated testing, potentially leading to a full database compromise.

Chainable
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Full Compromise
Component
Web Framework
Class
Credential Exposure
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

During test runs against an Oracle database, affected Django versions create a temporary database user with a hardcoded, predictable password. An attacker with network access to the database server can use this static credential to authenticate and gain full administrative privileges over the test database instance.

Why it matters to the business

An attacker could gain unauthorized access to the application's backend Oracle database during testing cycles. This could lead to a complete compromise of the database, including data theft, data modification, or service disruption. If test environments are not properly isolated or contain sensitive production-like data, this could result in a significant data breach.

How an attack unfolds

An attacker with network access to an Oracle database server used by a Django application for testing would wait for a test suite to be executed, for example, by a developer or a CI/CD pipeline. When the test starts, Django creates a temporary user (typically prefixed with 'test_') with a hardcoded password. The attacker, knowing this password, authenticates to the database server and gains full control over the test database. From there, they can exfiltrate any data within it or potentially use it as a pivot point to attack other systems if the environment is not properly segmented.

How to fix it

Upgrade affected Django instances to a patched version: 1.8.16, 1.9.11, 1.10.3, or a later release. If an immediate upgrade is not feasible, implement the workaround by manually specifying a strong, unique password for the test database user. This can be done by setting the 'PASSWORD' key in the 'TEST' dictionary within the database settings.

How to confirm the fix worked

To confirm remediation, verify that the installed Django version is 1.8.16, 1.9.11, 1.10.3, or newer. Alternatively, for applications using an Oracle backend, inspect the project's settings file to ensure that the `DATABASES['default']['TEST']` dictionary explicitly defines a strong password, which overrides the vulnerable default.

Typical attack path

  1. An attacker gains network access to the Oracle database server used for Django application testing.
  2. A developer or CI/CD pipeline initiates the application's test suite.
  3. The Django framework connects to the database and creates a temporary user with a known, hardcoded password.
  4. The attacker authenticates to the database server using the temporary user's credentials.
  5. The attacker gains full control over the test database, leading to data exfiltration or other malicious activities.

How to detect it

Monitor Oracle database audit logs for authentication events. Look for successful logins from unexpected IP addresses using temporary user accounts, which are typically prefixed with `test_`. Correlate these login events with the execution times of CI/CD pipelines or developer test runs. Any activity from these temporary accounts outside of automated test execution, such as creating new users or executing data export queries, is a strong indicator of compromise.

What your security team should do

  • Identify all Django applications using an Oracle database backend and prioritize them for patching based on the sensitivity of data in their test environments.
  • Upgrade affected Django instances to a secure version (1.8.16+, 1.9.11+, 1.10.3+).
  • If patching is delayed, ensure development teams apply the workaround of manually setting a strong test database password in the application's configuration.
  • Audit network security groups and firewall rules to ensure test database servers are not accessible from untrusted networks.

The record

Django 1.8.x before 1.8.16, 1.9.x before 1.9.11, and 1.10.x before 1.10.3 use a hardcoded password for a temporary database user created when running tests with an Oracle database, which makes it easier for remote attackers to obtain access to the database server by leveraging failure to manually specify a password in the database settings TEST dictionary.

Affected packages

Ecosystem Package Introduced Fixed
PyPI django 1.10 1.10.3
PyPI django 1.10a1 1.10.3
PyPI django 1.8 1.8.16
PyPI django 1.8a1 1.8.16
PyPI django 1.9 1.9.11
PyPI django 1.9a1 1.9.11
Alpine:v3.10 py-django 0 1.8.16-r0
Alpine:v3.11 py3-django 0 1.8.16-r0
Alpine:v3.12 py3-django 0 1.8.16-r0
Alpine:v3.2 py-django 0 1.8.16-r0
Alpine:v3.3 py-django 0 1.8.16-r0
Alpine:v3.4 py-django 0 1.8.16-r0
Alpine:v3.5 py-django 0 1.8.16-r0
Alpine:v3.6 py-django 0 1.8.16-r0
Alpine:v3.7 py-django 0 1.8.16-r0
Alpine:v3.8 py-django 0 1.8.16-r0
Alpine:v3.9 py-django 0 1.8.16-r0
Debian:11 python-django 0 1:1.10.3-1
Debian:12 python-django 0 1:1.10.3-1
Debian:13 python-django 0 1:1.10.3-1
Debian:14 python-django 0 1:1.10.3-1
Debian:8 python-django 0 1.7.11-1+deb8u2
Mageia:5 python-django 0 1.8.16-1.mga5
SUSE:OpenStack Cloud 6 python-Django 0 1.8.19-3.6.1
SUSE:OpenStack Cloud 7 python-Django 0 1.8.19-3.4.1
Ubuntu:14.04:LTS python-django 0 1.6.1-2ubuntu0.16
Ubuntu:16.04:LTS python-django 0 1.8.7-1ubuntu5.4
pypi Django 1.10a1 No fix
pypi Django 1.8a1 No fix
pypi Django 1.9a1 No fix

Related vulnerabilities