Skip to content

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

Open
@Ddfulton

Description

@Ddfulton

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions