Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60501 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68162 invoked from network); 7 May 2012 08:31:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 May 2012 08:31:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-wg0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:48362] helo=mail-wg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/64-33304-74887AF4 for ; Mon, 07 May 2012 04:31:03 -0400 Received: by wgbfg15 with SMTP id fg15so3752960wgb.11 for ; Mon, 07 May 2012 01:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rzWPv+wgtW1tJySYfz7nD/0d5zzoF1DrjQViOqVUvGQ=; b=aDjpcniW0iRtO5P95l4gdopPhNAtOGqYOTC77RDtIMH9TgBETj3Ert0GquHu3U6bh1 r7JtSYgMBFreRCwsQW3xQgA3XxxrhMaQznU7ki7etpzdBqCyTNfuc8TWAZJFyVbdihpz 21d0qoYwHJPgCcCFzh+q4Hs6qt5tvPhRgc3ngpW5TnewW+cfWoHB4KnN3B24es5GMHGI M22QoYdO+dIDcZ5NpJ1wTD4321aXY0c6g5AQxI9B9n/TwduTA1Vi8TBlw/qjuqEpNYr9 CskZoNAH47/zCLIbjrTLTv+sqS3Rsi25PFqmAsd0vSeYQlDM5cy2WPEuHgfMKPecPIy8 kD1A== MIME-Version: 1.0 Received: by 10.216.198.14 with SMTP id u14mr505913wen.12.1336379460291; Mon, 07 May 2012 01:31:00 -0700 (PDT) Received: by 10.223.96.129 with HTTP; Mon, 7 May 2012 01:31:00 -0700 (PDT) In-Reply-To: References: <4F847B8A.9010007@sugarcrm.com> <733bc8ea59cf6737563a62886e92fcb6.squirrel@www.l-i-e.com> Date: Mon, 7 May 2012 01:31:00 -0700 Message-ID: To: Arvids Godjuks Cc: Tjerk Anne Meesters , PHP Internals , Richard Lynch Content-Type: multipart/alternative; boundary=0016e6d59ec6040b0404bf6e17d9 Subject: Re: [PHP-DEV] [off] PHP: a fractal of bad design From: kris.craig@gmail.com (Kris Craig) --0016e6d59ec6040b0404bf6e17d9 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Mon, May 7, 2012 at 12:28 AM, Arvids Godjuks w= rote: > Hello internals, > > I should voice my opinion that such things like comparing two strings > starting with numbers and that they resolve to actual integer/float for > comparation is bad, really bad. That just defies the logic and yealds > absolutly unexpected results. I pride myself that i know the juggling rul= es > well, but I'm shocked by this to say the least... > In my opinion this should change no matter the BC breaks it will create, > this one affects security big time. It's good I actually hash my password= s > in the MySQL and not on the PHP side, but I have seen hash comparations > with =3D=3D all the time. And now that this has been discussed in detail = I > expect this to be used as an attack method grow wide. > 07.05.2012 5:32 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 "Tjerk Anne Meesters= " > =CE=C1=D0=C9=D3=C1=CC: Forgive me if I'm missing something, but why are people using =3D=3D for security-sensitive string comparisons (like hashed passwords) in the first place?! If you needs something that's safe, isn't that what strcmp() and strcasecmp() are for? For my part, I pretty much never use =3D=3D on strin= g comparison, though admittedly that's probably just a matter of having having come from a C background before PHP. That being said, I agree that this *definitely* should be fixed if the examples cited are indeed accurate (I've been working with PHP for over 10 years and I was never aware of this bizarre behavior, either). I don't know the history of this, but I at least would consider it to be a bug. A rather large one, in fact; though I think some of the fears expressed are a bit hyperbolic. And if you're fixing a serious bug or security vulnerability, as a general rule of thumb, this automatically supercedes any concerns regarding BC breakage IMHO. But if that really is a lingering concern, I'd suggest targetting the fix for PHP 6, since people would (or at least should) expect that some PHP 5 code may behave differently in PHP 6 anyway given that it's a major release --Kris --0016e6d59ec6040b0404bf6e17d9--