Junglewise Threat Intelligence

CVE-2019-3498: PYSEC-2019-17 - In Django 1.11.x before 1.11.18, 2.0.x before 2.0.10, and 2.1.x before 2.1.5, an Improper Neutralization of Special Elements in Output Used

CVE-2019-3498 · Severity: low · CVSS 3 · Published 2019-01-09

Technologies: Django (PyPI). Vendors: PyPI, Django.

Executive brief

Django, a popular Python web framework, contains a flaw in how it displays error messages on 404 (page not found) error pages. An attacker can craft a malicious URL that, when a user visits it, causes Django to display forged content on the error page. A user who doesn't carefully examine the URL or browser address bar may be tricked into believing they are viewing legitimate content, potentially leading to credential theft or malware distribution.

Technical details

The vulnerability is an improper neutralization of special elements (CWE-20) in the django.views.defaults.page_not_found() function. When a requested URL does not exist, Django displays a 404 error page that includes the attempted URL. The function fails to properly sanitize or escape the URL in the error page output, allowing an attacker to inject HTML or JavaScript that will be rendered in the user's browser. The attack requires user interaction (the user must click a malicious link), but no authentication is needed. An attacker can exploit this to perform content spoofing attacks. Patches are available in Django 1.11.18, 2.0.10, and 2.1.5.

Affected products

  • Django Django 1.11.x before 1.11.18, 2.0.x before 2.0.10, 2.1.x before 2.1.5

Timeline

  • 2019-01-09: disclosed
  • 2019-01-14: advisory
  • 2019-01: patched

References

Related threats