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

validators.hostname lets long hostnames through if they contain periods #413

Open
Ddfulton opened this issue Feb 14, 2025 · 0 comments
Open

Comments

@Ddfulton
Copy link

Ddfulton commented Feb 14, 2025

Best explained with a very simple example:

>>> long_name_with_periods = 'kld8MXQh6YalMqKRbfs895gMjW5T4p2EwToPoCSThPHHbXgmXc.kld8MXQh6YalMqKRbfs895gMjW5T4p2EwToPoCSThPHHbXgmXc.kld8MXQh6YalMqKRbfs895gMjW5T4p2EwToPoCSThPHHbXgmXc.kld8MXQh6YalMqKRbfs895gMjW5T4p2EwToPoCSThPHHbXgmXc.kld8MXQh6YalMqKRbfs895gMjW5T4p2EwToPoCSThPHHbXgmXcab'

>>> assert len(lon_name_with_periods) > 255  # should be too long regardless of whether the dot-delimited "phrases" are <63chars

>>> assert validators.hostname(long_name_with_periods)  # Slips through the cracks

Maybe this has to do with the _simple_hostname_regex function?

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