Description
An issue was discovered in Django 6.0 before 6.0.7 and 5.2 before 5.2.16.
`DomainNameValidator` does not prohibit newlines in domain names (unless used via a form field, since `CharField` strips newlines). If an application uses values with newlines in an HTTP response, header injection can occur. Django itself is unaffected because `HttpResponse` prohibits newlines in HTTP headers.
Earlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected.
Django would like to thank Bence Nagy for reporting this issue.
Published: 2026-07-07
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

DomainNameValidator in Django permits newline characters in domain names. When an application places such a domain name directly into an HTTP response header without validation, the newline can split the header and enable header injection. This flaw therefore provides a path for malicious manipulation of HTTP responses.

Affected Systems

Django releases earlier than 6.0.7 and 5.2.16 are affected. The flaw was identified in Django 6.0 before 6.0.7 and in Django 5.2 before 5.2.16. Earlier unsupported branches such as 5.0.x, 4.1.x, and 3.2.x were not evaluated but may contain identical code and consequently could also be vulnerable.

Risk and Exploitability

The CVSS score of 5.3 places the vulnerability in the medium severity range. Exploitation requires that an attacker be able to supply a domain name that the application writes to a header without prior sanitization, thereby limiting the attack scope to the application’s own logic or input handling. The EPSS score of <1% indicates a very low probability of real-world exploitation. Django’s own HttpResponse sanitizes headers, so the core framework remains safe; the risk arises only when application code bypasses that protection. The vulnerability is not listed in the CISA KEV catalog.

Generated by OpenCVE AI on July 25, 2026 at 20:54 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Django to 6.0.7 or later, or to 5.2.16 or later, to receive the official fix that rejects newlines in DomainNameValidator
  • Identify and review all application code that constructs HTTP response headers containing domain names, and validate or sanitize those values to remove newline or other control characters
  • If an upgrade cannot be performed immediately, avoid placing untrusted domain names into HTTP headers, or explicitly strip newline characters before header construction

Generated by OpenCVE AI on July 25, 2026 at 20:54 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 11 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-113
References
Metrics threat_severity

None

threat_severity

Low


Tue, 07 Jul 2026 16:45:00 +0000

Type Values Removed Values Added
First Time appeared Djangoproject
Djangoproject django
Vendors & Products Djangoproject
Djangoproject django

Tue, 07 Jul 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 07 Jul 2026 15:00:00 +0000

Type Values Removed Values Added
Description An issue was discovered in Django 6.0 before 6.0.7 and 5.2 before 5.2.16. `DomainNameValidator` does not prohibit newlines in domain names (unless used via a form field, since `CharField` strips newlines). If an application uses values with newlines in an HTTP response, header injection can occur. Django itself is unaffected because `HttpResponse` prohibits newlines in HTTP headers. Earlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected. Django would like to thank Bence Nagy for reporting this issue.
Title Header injection possibility since DomainNameValidator accepted newlines in input
Weaknesses CWE-144
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}


Subscriptions

Djangoproject Django
cve-icon MITRE

Status: PUBLISHED

Assigner: DSF

Published:

Updated: 2026-07-07T14:58:18.415Z

Reserved: 2026-06-11T01:11:27.546Z

Link: CVE-2026-53878

cve-icon Vulnrichment

Updated: 2026-07-07T14:58:15.123Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Low

Publid Date: 2026-07-07T14:00:00Z

Links: CVE-2026-53878 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-25T21:00:14Z

Weaknesses
  • CWE-113

    Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')

  • CWE-144

    Improper Neutralization of Line Delimiters