From: John Perkins Date: Mon, 6 Oct 2014 21:24:57 +0000 (-0500) Subject: Fix hostname regex pattern X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1681f62ec91b6c3705a14393815542dc1746de71;p=openstack-build%2Fneutron-build.git Fix hostname regex pattern Current hostname_pattern regex complexity grows exponentially when given a string of just digits, which can be exploited to cause neutron-server to freeze. Change-Id: I886c6d883a9cb0acd9908495eec50bf0411d8ba8 Closes-bug: #1378450 --- diff --git a/neutron/api/v2/attributes.py b/neutron/api/v2/attributes.py index 893d0446d..1edcb7d0b 100644 --- a/neutron/api/v2/attributes.py +++ b/neutron/api/v2/attributes.py @@ -538,8 +538,8 @@ def convert_to_list(data): return [data] -HOSTNAME_PATTERN = ("(?=^.{1,254}$)(^(?:(?!\d+\.|-)[a-zA-Z0-9_\-]" - "{1,63}(?