CVE-2026-53878: Django DomainNameValidator header injection via newline characters

CVE-2026-53878 · Severity: medium · CVSS 6.1 · Published 2026-07-07

A vulnerability was identified in Django, a popular web framework, where certain domain name validation checks failed to block newline characters. If an application uses these validated domain names directly in web responses, an attacker could potentially inject malicious headers into the communication. This could lead to various security issues, such as redirecting users to malicious sites or bypassing certain security controls, though Django's default response handler provides some built-in protection against this specific behavior.

Technologies: Django (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-53878 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-53878 being exploited in the wild.
How severe is CVE-2026-53878?
Medium severity, with a CVSS score of 6.1, published 7 July 2026.
Which products and versions are affected?
Django (PyPI) ECOSYSTEM:introduced=0,fixed=5.2.16, ECOSYSTEM:introduced=5.2,fixed=5.2.16,introduced=6.0,fixed=6.0.7.
Is there a fix for CVE-2026-53878?
Yes. Django (PyPI): upgrade to 5.2.16, 6.0.7 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-53878 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-53878?
Check whether you run Django (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Django (PyPI): upgrade to 5.2.16, 6.0.7 or later
    pip install "Django>=6.0.7"

Technical details

A vulnerability exists in Django's DomainNameValidator where it fails to prohibit newline characters in domain names. While Django's CharField typically strips newlines when used in forms, the validator itself does not, potentially allowing malicious input to pass through if used in other contexts. If an application subsequently includes these validated strings in an HTTP response header, it could lead to HTTP header injection (CWE-144). Although Django's HttpResponse class prohibits newlines in headers by default, applications using alternative response methods or manual header construction may be vulnerable. The issue is patched in versions 5.2.16 and 6.0.7.

Affected products

  • Django Software Foundation Django 5.2 before 5.2.16, 6.0 before 6.0.7

Identifiers

  • CVE-2026-53878
  • GHSA-8qcx-xf44-272x
  • PYSEC-2026-2092

Timeline

  • 2026-07-07: disclosed
  • 2026-07-07: patched
  • 2026-07-07: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.