TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

PHP bug: Password_verify() always return true with some hash

43 点作者 dutchbrit超过 2 年前

12 条评论

mikehall314超过 2 年前
I'm actually quite surprised at the initial response by the PHP Core to this vulnerability. At very least I would have thought a sensible approach would be to fail securely - so if supplied with a bad hash you return false, not true!
评论 #34909824 未加载
0xFEE1DEAD超过 2 年前
&gt; I fail to see how this is a bug if you feed it garbage<p>What an awful response to someone reporting a pretty serious security vulnerability.
评论 #34910054 未加载
评论 #34910001 未加载
评论 #34910228 未加载
donatj超过 2 年前
Many comments here vastly overstate the seriousness of this. For it to be used as an attack, the attacker needs general write access to your database. You probably have much bigger issues on your hands if that is the case.<p>If they have write access they can already just set the hash to a known value for the same result.<p>It’s a bug certainly but of very little practical security concern.
评论 #34910165 未加载
评论 #34910203 未加载
mjburgess超过 2 年前
More info: <a href="https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src&#x2F;security&#x2F;advisories&#x2F;GHSA-7fj2-8x79-rjf4">https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src&#x2F;security&#x2F;advisories&#x2F;GHSA-7fj2...</a><p>seems to be caused by a strange non-std php-specific crypto implementation
评论 #34909790 未加载
bawolff超过 2 年前
That&#x27;s interesting, but i don&#x27;t see how this can actually be leveraged into a vulnerability.<p>But gosh, between this and the sha with null truncating bcrypt bug, php has had bad luck implementing password routines.
评论 #34909789 未加载
评论 #34909816 未加载
评论 #34909834 未加载
hiccuphippo超过 2 年前
<p><pre><code> This issue is caused by a PHP specific modification to the crypt_blowfish implementation that is fittingly named “PHP hack”: php-src&#x2F;ext&#x2F;standard&#x2F;crypt_blowfish.c Line 374 in 2740920 if (tmp == &#x27;$&#x27;) break; &#x2F;* PHP hack *&#x2F; </code></pre> Cheeky hacker.
captn3m0超过 2 年前
The GitHub advisory is a better location to point this submission to: <a href="https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src&#x2F;security&#x2F;advisories&#x2F;GHSA-7fj2-8x79-rjf4">https:&#x2F;&#x2F;github.com&#x2F;php&#x2F;php-src&#x2F;security&#x2F;advisories&#x2F;GHSA-7fj2...</a>
jefftk超过 2 年前
password_verify was erroneously returning true for include hashes. In the most common case where the user gives you a password and you immediately hash it and call password_verify this doesn&#x27;t come up, but any case where an attacker can influence the hash is at risk (ex: hashing on the client).<p>The first comment on the bug report is pretty depressing.
评论 #34909866 未加载
aldousd666超过 2 年前
Man, he tried so hard to defend that bug.
jupp0r超过 2 年前
Still one of the best blog articles ever written: &quot;PHP: a fractal of bad design&quot; <a href="https:&#x2F;&#x2F;eev.ee&#x2F;blog&#x2F;2012&#x2F;04&#x2F;09&#x2F;php-a-fractal-of-bad-design&#x2F;" rel="nofollow">https:&#x2F;&#x2F;eev.ee&#x2F;blog&#x2F;2012&#x2F;04&#x2F;09&#x2F;php-a-fractal-of-bad-design&#x2F;</a>
评论 #34909864 未加载
评论 #34910128 未加载
评论 #34909933 未加载
评论 #34909856 未加载
mgrund超过 2 年前
Could also be a backdoor in combination with another yet-to-be-discovered bug…
derrida超过 2 年前
For some reason when ever I&#x27;ve had to work with PHP which was last about 10 years ago I got giggles &amp; &quot;TNT&quot; by ACDC would play in my head. I&#x27;m remembering why...<p>P.H.P<p>DYNAMITE