Skip to content

_check_private_ip does not include 172.16.0.0/12 addresses #564

Open

Description

@bryanward-net

IPv4 Address Validation _check_private_ip does not include 172.16.0.0/12 addresses

for l_bit in {
"10.", # private
"192.168.", # private
"169.254.", # link-local
"127.", # localhost
"0.0.0.0", # loopback #nosec
}

For consistency with the ipaddress library, you should probably just use ipaddress.IPv4Address.is_private() instead. It handles several other cases not included here.
https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address.is_private

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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