Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86055 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65299 invoked from network); 30 Apr 2015 02:00:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2015 02:00:34 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.177 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.177 mail-wi0-f177.google.com Received: from [209.85.212.177] ([209.85.212.177:33982] helo=mail-wi0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/20-64175-2CC81455 for ; Wed, 29 Apr 2015 22:00:34 -0400 Received: by wicmx19 with SMTP id mx19so2350519wic.1 for ; Wed, 29 Apr 2015 19:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=wTddhbpDslH9Nw4bLr5m5MumPynnybYb3To2cpEmjDE=; b=nSqEmdd/ThIptFVw2Y6j4zO2b3s9PuR+JOwc8Iwc5fHMXYibPFki6AwjN5uJRa6t06 P52XuznVFikHGWW4KPXdnPC+X3GlWsn8h2W/mbVLzzlnGNuvzkbG3Nj35XECNyJs1Mud flHwIYKPkvjOHZakRr/avBggADpzaWkoaWu3m5WDirEHVuXEgkpAtGCqqhPkxMmz4s1F 2AUCH0yaazcz8nf1Oq9sqxnpITRh4RGdrXDDRuy8zo2LHWuVE1err42mc8RT59k/nRtK OWx+z+4OgcMglMPX6JqzZDIpEOFLEILA0O8IzDFcMsIH0V7+0Vi0o9BuyQkeb5l/zwuT tD5w== X-Received: by 10.181.13.113 with SMTP id ex17mr1003646wid.12.1430359231701; Wed, 29 Apr 2015 19:00:31 -0700 (PDT) Received: from [192.168.0.5] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id ez19sm159505wid.19.2015.04.29.19.00.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 19:00:30 -0700 (PDT) Message-ID: <55418CBE.6050609@gmail.com> Date: Thu, 30 Apr 2015 03:00:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: <55401F31.9030703@gmail.com> <55416849.9010808@gmail.com> <554176D6.2030007@gmx.de> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Adding "numeric" type hint From: rowan.collins@gmail.com (Rowan Collins) On 30/04/2015 02:24, Yasuo Ohgaki wrote: >> "Type hints" have never been hints. The wording is a misnomer. Try to >> pass an int to a parameter declared as array, for instance. >> > I understand how it worked and how it will. > "hint" sounds a little misleading. Since we named it already, we may follow > the semantics. Or, since we chose the semantics already, we may consider better names (see on-going discussion on PHP-DOC list, for example). >> A fatal error wouldn't constitute a DoS vulnerability, would it? >> > Attacker may inject huge ID value and/or they may simply access > web sites to reach 2 billion limit, for example. That's not a DoS vector unless you've also done something else wrong, it's just an embarassing error like many others. A lot of the time, the DB will overflow first anyway, because an SQL "int" is signed 32-bit. Hell, YouTube had a 32-bit int for number of views until Gangnam Style overflowed it! Sure, if a user can somehow insert custom data into a BigInt DB column, via a 32-bit webserver, without causing the error on the way in, but in such a way that other users would end up retrieving that record when they tried to access the site, and it was then run through a function with an "int" type annotation you'd have a Denial of Service. That's hardly "PHP 7 broke my website", though. Regards, -- Rowan Collins [IMSoP]