Skip to content

Reject invalid and overlong domain names - #458

Closed
uwezkhan wants to merge 1 commit into
python-validators:masterfrom
uwezkhan:fix/domain-validation-bypass
Closed

uwezkhan wants to merge 1 commit into
python-validators:masterfrom
uwezkhan:fix/domain-validation-bypass

Conversation

@uwezkhan

Copy link
Copy Markdown

Fixes a domain validation bypass where invalid TLDs containing _ or -, and domains longer than the DNS maximum length, were accepted by domain() and indirectly by hostname().

@uwezkhan

uwezkhan commented Jul 1, 2026

Copy link
Copy Markdown
Author

update ?

@nandgator

Copy link
Copy Markdown
Collaborator

Thank you for the contribution! Parts of this are now on master via #461 (253-character limit) and #485 (underscore in the last label). The rest rewrites the TLD rules, which is a larger behaviour change than we want to take in one step. If you'd like to pursue that, please open an issue or a small PR against current master with ruff-clean code and tests. Closing for now.

@nandgator nandgator closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants