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=ad6fefcb4d4068b46b69284e277df6ab2ee30105;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 83471f946..21486dbd3 100644 --- a/neutron/api/v2/attributes.py +++ b/neutron/api/v2/attributes.py @@ -540,8 +540,8 @@ def convert_to_list(data): return [data] -HOSTNAME_PATTERN = ("(?=^.{1,254}$)(^(?:(?!\d+\.|-)[a-zA-Z0-9_\-]" - "{1,63}(?