CVE-2026-53878

Header injection possibility since DomainNameValidator accepted newlines in input

Published Jul 7, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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
  • Scan all application code that writes domain names to HTTP response headers; validate the values against a strict domain‑name whitelist and strip or reject any newline or carriage‑return characters (mitigating CWE‑113: HTTP Response Injection) and remove other control characters that could be used as job‑control input (mitigating CWE‑144)
  • If an upgrade cannot be performed immediately, sanitize any domain name before adding it to a header by removing all line‑breaks, rejecting values containing non‑printable control characters and escaping any legitimate characters; this reduces the risk of header injection while a permanent fix is deployed

Generated by OpenCVE AI on August 3, 2026 at 04:55 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-8qcx-xf44-272x Django: DomainNameValidator permits newline characters that may enable HTTP header injection
History
Type Values Removed Values Added
First Time appeared Djangoproject
Djangoproject django
Vendors & Products Djangoproject
Djangoproject django
Type Values Removed Values Added
Metrics ssvc

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

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'}

Weaknesses
  • CWE-113

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

  • CWE-144

    Improper Neutralization of Line Delimiters

Sources

Status
PUBLISHED
Assigner
DSF
Published
Updated
Jul 7, 2026, 2:58 PM
Reserved
Jun 11, 2026, 1:11 AM
Status
Analyzed
Published
Jul 7, 2026, 3:16 PM
Modified
Oct 25, 2026, 8:10 PM
Severity
Low
Public date
Jul 7, 2026, 2:00 PM