Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96043 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6818 invoked from network); 21 Sep 2016 06:54:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2016 06:54:57 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:35591] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/10-04117-DBE22E75 for ; Wed, 21 Sep 2016 02:54:55 -0400 Received: (qmail 83152 invoked by uid 89); 21 Sep 2016 06:54:50 -0000 Received: from unknown (HELO mail-qk0-f175.google.com) (yohgaki@ohgaki.net@209.85.220.175) by 0 with ESMTPA; 21 Sep 2016 06:54:50 -0000 Received: by mail-qk0-f175.google.com with SMTP id n185so37331379qke.1 for ; Tue, 20 Sep 2016 23:54:49 -0700 (PDT) X-Gm-Message-State: AE9vXwOJeC4pxJEm6DQM7n/WjPcRQbAgd1ucIUb4K1uiF8WbHjoBMAPLzXR053ZrJ2icr5nboveN8qsvFYR27w== X-Received: by 10.55.145.197 with SMTP id t188mr38614062qkd.233.1474440883276; Tue, 20 Sep 2016 23:54:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.84.168 with HTTP; Tue, 20 Sep 2016 23:54:02 -0700 (PDT) In-Reply-To: <9522ebc9-8d8b-045e-b701-02f1166063e6@gmail.com> References: <7d5727ba-da33-e3c5-1d1f-318c45d81616@cubiclesoft.com> <9522ebc9-8d8b-045e-b701-02f1166063e6@gmail.com> Date: Wed, 21 Sep 2016 15:54:02 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Stanislav Malyshev Cc: Scott Arciszewski , Thomas Hruska , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] HashDoS From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Stas, On Wed, Sep 21, 2016 at 11:26 AM, Stanislav Malyshev wrote: > >> I think we are better to limit max collisions. >> I'm +1 for Nikita's proposal does this. > > Max collision per what? How much would be the limit? Collision by keys. It would be nice to have configurable limit like regex stack/backtrack limit. That said, wouldn't 1000 enough for almost all apps? Anyway, we have two choices - Simply limit the number of collisions. (Fast and has no impact to code) - Use crypt safe hash and salt. (Slow and has impact to opcache/etc) Limiting something is good to have sometimes. Python even limits number of recursions to 1000 by default. We have PCRE stack/backtrack limits. (We'll have mbregex stack limit soon) Collision limit is good one also. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net