﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37515	DomainNameValidator accepts Unicode line/paragraph separators in domains	Shai Berger		"`django/core/validators.py` builds `hostname_re` / `domain_re` / `tld_re` using the raw codepoint range `[a-z\u00a1-\uffff0-9-]`. That range includes
Unicode line and paragraph separators and several invisible space characters (U+2028, U+2029, U+1680, U+2000–200A, U+3000, U+FEFF), so they are accepted whenever they appear in a non-final domain label.

`EmailValidator` and `URLValidator` reuse these regexes, so `EmailField.is_valid()` returns `True` for such values.

Two consequences:

1. `send_mail()` on a validated address raises an uncaught `ValueError` (""Header values may not contain linefeed or carriage return characters"") from Python's `email.policy` serialization. `PasswordResetForm.send_mail` swallows it via a broad `except Exception`; other callers surface it as a 500.
1. `django/core/mail/backends/smtp.py` `prep_address()` silently strips the separators, so the envelope recipient differs from the validated address (`user@example\u2028.com` → `user@example.com`).

POC script and its output attached.

== Suggested fix
In `DomainNameValidator.__call__()`, reject characters whose `unicodedata.category(ch)[0]` is `C` or `Z`, or narrow the `\u00a1-\uffff` range to actual letter/digit categories. This covers `EmailValidator`, `URLValidator`, and `simple_url_2_re` consumers.

Regression cases: `user@example\u2028.com`, `exa\u1680mple.com`, `http://example\u2029.com/`.

== Acknowledgement
This was a report received by the security team. The reporter did not respond when asked to open a ticket, so I'm opening it. I edited the report a little."	Bug	new	Forms	6.1	Normal		not-security		Accepted	0	0	0	0	0	0
