Junglewise Threat Intelligence

CVE-2016-9014: Django DNS rebinding vulnerability in Host header validation

CVE-2016-9014 · Severity: low · CVSS 3 · Published 2022-05-17

Vendors: Django.

Executive brief

Django, a widely-used Python web framework, did not properly validate HTTP Host headers when running in debug mode, allowing attackers to conduct DNS rebinding attacks. DNS rebinding is a technique where an attacker tricks a browser into making requests to unintended targets by manipulating DNS responses. This vulnerability could allow an attacker to bypass security controls and gain unauthorized access to Django applications running in debug mode.

Technical details

The vulnerability exists in Django versions 1.8 before 1.8.16, 1.9 before 1.9.11, and 1.10 before 1.10.3 when settings.DEBUG is True. The root cause is insufficient validation of the HTTP Host header against the settings.ALLOWED_HOSTS configuration. An attacker can perform a DNS rebinding attack by first resolving a domain to the attacker's IP, then after the browser connects, changing the DNS record to resolve to the target Django application's address. Because the Host header is not validated, the application accepts requests with a malicious Host header. This allows an attacker to bypass host-based access controls. The fix validates the Host header against ALLOWED_HOSTS and rejects requests with invalid hosts, even when DEBUG is enabled.

Affected products

  • Django Django 1.8 before 1.8.16, 1.9 before 1.9.11, 1.10 before 1.10.3

Timeline

  • 2016-11-01: disclosed: Security releases published by Django project
  • 2016-11-01: patched: Fixes released in Django 1.8.16, 1.9.11, and 1.10.3
  • 2022-05-17: advisory: GHSA-3f2c-jm6v-cr35 published

References