Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid URLs accepted with subdomains #156

Open
carton-of-mice opened this issue Dec 9, 2023 · 0 comments
Open

Invalid URLs accepted with subdomains #156

carton-of-mice opened this issue Dec 9, 2023 · 0 comments

Comments

@carton-of-mice
Copy link

If provided with a potential hostname with multiple dots, only the most top-level domain below the TLD is validated.

>>> import urlextract
>>> print(urlextract.URLExtract().find_urls('sample :--.-.:3.2.com sample'))
[':--.-.:3.2.com']

This report is related to #121 - after invalid characters are consumed, _is_domain_valid() only applies validation regex against host.split(".")[-2], ignoring invalid DNS labels in earlier parts.

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

No branches or pull requests

1 participant