Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96011 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42935 invoked from network); 16 Sep 2016 00:20:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2016 00:20:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.41 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.41 mail-pa0-f41.google.com Received: from [209.85.220.41] ([209.85.220.41:34673] helo=mail-pa0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BB/34-09226-0EA3BD75 for ; Thu, 15 Sep 2016 20:20:49 -0400 Received: by mail-pa0-f41.google.com with SMTP id wk8so20514448pab.1 for ; Thu, 15 Sep 2016 17:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=I+Nh9GqI/6TYOcmAg7uVw8/yic4ygddH1BuLzbfX7jA=; b=jbMomHGrKmIYVPnBthdUBe+kyCkO1L24roj0hXEwEd0yHWZvNrIr7zv07Xt1IF31qY k6zkYcrtkntq+I783UVG9yGnaF+QlVhEfqlIWpIhC4JfyuRIiCvpcBA1s5l/nJIIXU7s jSStZSdbcakVwdgmwvOswishUyJYF7dkgMHJwRTI8siRfIWySNBZPxiXVlvfF0tjHlna 06Zlcx4DHNWnNHFWRVuwA6NFXVeM4z2Fi9xIHuZCCe4UlsUtSTQgr/b+KLptxSY5or4E 6zJLXT6nT+MvA151LFYnA3qfilKE+m+ygrdafX+UJZ3dL/hlmHmnmtuDXWXfCydPIk0J YuRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=I+Nh9GqI/6TYOcmAg7uVw8/yic4ygddH1BuLzbfX7jA=; b=LdBPNAWcBUDrYQLCcFOy+TKPwkhdUbDLY+PHSMGMLoMkD7VUrJ6JQGFkTfDA2L59R4 D/XZuZiUSSKBubNXAQBCXS4GEt/hhccjHusg8863V6bv6Qnb9fa8M5KbuHK0AvgFzN1H BdPwjPBGP7Dq0K6MD6LtTxO7lduOSV1ouOzFVStSCqeoHw4RBpLhdTungdWSv5ZwProo 8YcqrlAy1WwITRgFacSkvZEhjSzfPBi6kgXBF4PeP/aQCDkkcKEm3fWm4WQhZkZj++aM BslPiyOpeMhiUeaJFgqhtgPvzE5UvCoKlrmkan7T2FNCZsik/ArEgrmDNEzRXaCE9hBl 9NxA== X-Gm-Message-State: AE9vXwMelF7+FOcWa4AReis0lhQCRxEwPjD+3/hZB4DM37Sj+lfyJsjad7btGEVIxwAqbw== X-Received: by 10.66.149.138 with SMTP id ua10mr999835pab.146.1473985245408; Thu, 15 Sep 2016 17:20:45 -0700 (PDT) Received: from ?IPv6:2602:306:ce9c:e680:9cc9:c45e:9934:de37? ([2602:306:ce9c:e680:9cc9:c45e:9934:de37]) by smtp.gmail.com with ESMTPSA id s7sm47567022pfk.11.2016.09.15.17.20.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Sep 2016 17:20:44 -0700 (PDT) To: Scott Arciszewski , PHP Internals References: Message-ID: Date: Thu, 15 Sep 2016 17:20:43 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] HashDoS From: smalyshev@gmail.com (Stanislav Malyshev) Hi! On 9/15/16 11:48 AM, Scott Arciszewski wrote: > Would the Internals team be open to discussing mitigating HashDoS in a > future version of PHP? i.e. everywhere, even for json_decode() and friends, > by fixing the problem rather than capping the maximum number of input > parameters and hoping it's good enough. > > I'd propose SipHash (and/or a derivative): https://www.131002.net/siphash/ I am worries about performance. Base hash structure has to be *very* fast. I have doubts that cryptographic function can perform at these levels. Did you test what is performance of this function compared to existing hash function? > > (Look at all the other languages that already adopted SipHash.) Adopted as base data structure in the engine? Which ones? What were the performance costs? -- Stas Malyshev smalyshev@gmail.com