News for hackers. Stuff that matters.
Re:PHP bug: Password_verify() always return true with some hash by jupp0r on Thursday February 23, 2023 @07:53AM (#34909823)
Still one of the best blog articles ever written: "PHP: a fractal of bad design" https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
Re:PHP bug: Password_verify() always return true with some hash by smt88 on Thursday February 23, 2023 @07:56AM (#34909864)
I hate PHP, but that article is so old and outdated now that it's meaningless in this context. PHP is a completely different language with far more strict typing to opt into and more consistent stdlib APIs.
Re:PHP bug: Password_verify() always return true with some hash by hiccuphippo on Thursday February 23, 2023 @08:34AM (#34910343)
Most of what it says is still true today. Stdlib did add new functions and flags (which only add to the inconsistency) but most the ones the article mentions still have the same behavior today. Plus new issues as well.

Something I found the other day, typed parameters won't error if you change the type, even with strict_types turned on:

    function foo(string $foo) {
        $foo = 10;
    }
Re:PHP bug: Password_verify() always return true with some hash by smt88 on Thursday February 23, 2023 @09:43AM (#34911184)
Yeah, I mean it's still a dynamic language with the pitfalls that come with it (many shared with JS and Python).

Do I think dynamic languages are terrible and hate all three of the above? Yes.

Do I think modern, idiomatic PHP still suffers from most of TFA's examples of bad design? No.

Re:PHP bug: Password_verify() always return true with some hash by rafark on Tuesday March 07, 2023 @04:27PM (#35061502)
This is expected behavior and works like a charm. The type of a variable can always change at any time. The argument hint is designed to make sure you’re given the expected type. Not that the variable will only hold that type.
Re:PHP bug: Password_verify() always return true with some hash by derrida on Thursday February 23, 2023 @08:17AM (#34910125)
I hope it never changes.

PHP reminds me of my socially awkward uncle who is endearing and means well and caused many cringes & me and my sister to laugh with his faux pas.

I love reading articles about its bugs. The Mr Bean of programming languages.

We need PHP just as the film industry needs its gaffer tape. It's just that we have a very good standard of Gaffer tape (357 or "perl" in programming). It is kinda expensive though in dollars or cognitive cycles. So sometimes we use the inferior stuff that is not the standard 357. But then, we find, after the film bumps out - it caused you to rip the paint off the floor in the venue the film hired and not get your $10,000k deposit back.

We need to have our humour.

Re:PHP bug: Password_verify() always return true with some hash by smt88 on Thursday February 23, 2023 @09:38AM (#34911105)
Honestly we don't need PHP, which we've proven because basically no one uses it for anything other than WordPress, Drupal, and (internally) Facebook now. Facebook may even have finished porting all their PHP to Hack and other languages.

There will be a few HN commenters who say they still use Laravel or something, but in reality it's a tiny percentage of people using it now.

Re:PHP bug: Password_verify() always return true with some hash by tangue on Thursday February 23, 2023 @08:17AM (#34910128)
This guy should have monetized his blog, as in every discussion vaguely related to php someone come with a link to this page.
Re:PHP bug: Password_verify() always return true with some hash by stef25 on Thursday February 23, 2023 @08:46AM (#34910488)
Instead it's just costing him money. PHP takes revenge.
Re:PHP bug: Password_verify() always return true with some hash by donatj on Thursday February 23, 2023 @08:02AM (#34909933)
Most inflammatory? Yes. Best? No.
Re:PHP bug: Password_verify() always return true with some hash by stef25 on Thursday February 23, 2023 @07:55AM (#34909856)
Obligatory "that article is from 10 years ago and it's really not the same PHP anymore"
Re:PHP bug: Password_verify() always return true with some hash by quchen on Thursday February 23, 2023 @08:02AM (#34909932)
OP’s link disagrees. A critical vulnerability being called »not a bug RTFM« is the same cultural and engineering level of »string length as hash function what’s the problem«.
Re:PHP bug: Password_verify() always return true with some hash by aeyes on Thursday February 23, 2023 @08:07AM (#34910006)
The response is wrong though. The RFC for this function which someone quoted further down in the bug report clearly stated that it should return false even if you feed it a garbage hash.
Re:PHP bug: Password_verify() always return true with some hash by stef25 on Thursday February 23, 2023 @08:07AM (#34910015)
The initial response to the report is obviously quite shocking, not disagreeing there.
Re:PHP bug: Password_verify() always return true with some hash by bawolff on Thursday February 23, 2023 @08:04AM (#34909973)
This bug is obviously not critical.