<div dir="ltr">Let me demystify this bug. It is so trivial, at the end of the day, I will ask some questions here, openly on the list!?<div><br></div><div>It is, after all, most of 13K Front Line Managers in INTEL with reputations on stake for this bug, with really questionable (minimum required) qualities, as well as technical, as well as human/personal characteristics!</div><div><br></div><div>It is just that some INTEL junior programmer was so thrilled about C lib recent acquired knowledge, that (s)he, by unconscious mistake, used f-n strncmp() instead much safer strcmp()???</div><div><br></div><div>What about INTEL testing teams? INTEL QA teams?!</div><div><br></div><div>Zoran Stojsavljevic<br><div>_______</div><div><br><div><ul style="box-sizing:inherit;list-style:none;margin:0px;padding:0px;color:rgb(0,0,0);font-family:opensans;font-size:15px;background-color:rgb(240,241,242)"><li class="gmail-comment" style="box-sizing:inherit;margin:0px;padding:18px 0px;border-top:1px solid rgb(204,204,204)"><div class="gmail-body" style="box-sizing:inherit;font-size:14px;line-height:19px"><a href="https://arstechnica.com/civis/memberlist.php?mode=viewprofile&u=565983" style="color:inherit;background-color:transparent;font-family:bitter;font-size:15px;box-sizing:inherit;text-decoration-line:none">MemberBerry</a><span style="font-family:bitter;font-size:15px"> </span><span class="gmail-rank" style="box-sizing:inherit;font-size:11px;color:rgb(104,104,104)">Wise, Aged Ars Veteran</span><br></div></li><li class="gmail-comment" style="box-sizing:inherit;margin:0px;padding:18px 0px;border-top:1px solid rgb(204,204,204)"><div class="gmail-body" style="box-sizing:inherit;font-size:14px;line-height:19px">The article is a bit confusing regarding this, but no, you can't send an empty password. That's because when a browser does digest authentication it doesn't actually send the password, or even a password hash, to the web server.<br style="box-sizing:inherit"><br style="box-sizing:inherit">The browser sends instead a response MD5 hash computed on a string composed of various items, including a variable nonce sent by the server, in addition to the password, for example:<br style="box-sizing:inherit"><br style="box-sizing:inherit"><span style="box-sizing:inherit;font-weight:bold">response=MD5(MD5(username:realm:password):nonce:MD5(method:digestURI))</span><br style="box-sizing:inherit"><a class="gmail-postlink" href="https://en.wikipedia.org/wiki/Digest_access_authentication" style="box-sizing:inherit;background-color:transparent;text-decoration-line:none;color:rgb(255,78,0)">https://en.wikipedia.org/wiki/Digest_ac ... entication</a><br style="box-sizing:inherit"><br style="box-sizing:inherit">This means a normal browser would never send an empty response, even when you enter an empty password. It would always send a 32 hex digit MD5 hash looking like this:<br style="box-sizing:inherit"><br style="box-sizing:inherit"><span style="box-sizing:inherit;font-weight:bold">response="6629fae49393a05397450978507c4ef1"</span><br style="box-sizing:inherit"><br style="box-sizing:inherit">The server would then compute the same hash, and compare them. If they are equal, it allows login, if they are different it denies login.<br style="box-sizing:inherit"><br style="box-sizing:inherit">The bug was in the code to compare the two strings. It used the strncmp function that compares the first N characters of two strings:<br style="box-sizing:inherit"><br style="box-sizing:inherit"><span style="box-sizing:inherit;font-weight:bold">strncmp(string1, string2, N)</span><br style="box-sizing:inherit"><a class="gmail-postlink" href="http://www.cplusplus.com/reference/cstring/strncmp/" style="box-sizing:inherit;background-color:transparent;text-decoration-line:none;color:rgb(255,78,0)">http://www.cplusplus.com/reference/cstring/strncmp/</a><br style="box-sizing:inherit"><br style="box-sizing:inherit">And applied it to the computed hash and the hash response received from the browser, with N set to the length of the response received from the browser, so something like:<br style="box-sizing:inherit"><br style="box-sizing:inherit"><span style="box-sizing:inherit;font-weight:bold">strncmp(computed_hash, response, strlen(response))</span><br style="box-sizing:inherit"><br style="box-sizing:inherit">So when it compared a real hash generated by a browser it would do something like:<br style="box-sizing:inherit"><br style="box-sizing:inherit"><span style="box-sizing:inherit;font-weight:bold">strncmp("6629fae49393a05397450978507c4ef1","d3d4914a43454b159a3fa6f5a91d801d", 32)</span><br style="box-sizing:inherit"><br style="box-sizing:inherit">This would work just fine for hashes sent by the browser, which are always 32 characters in length. Even if the password field is empty, it would compare the two strings, they wouldn't match, and it would reject the empty password or invalid password.<br style="box-sizing:inherit"><br style="box-sizing:inherit">So anyone testing this from a browser would find it works perfectly.<br style="box-sizing:inherit"><br style="box-sizing:inherit">The problem is what happens if you don't use a browser, but you generate an invalid request manually or using a proxy to alter the response, sending an empty string instead of the 32 character hash. Then the compare code does this:<br style="box-sizing:inherit"><br style="box-sizing:inherit"><span style="box-sizing:inherit;font-weight:bold">strncmp("6629fae49393a05397450978507c4ef1","",0)</span><br style="box-sizing:inherit"><br style="box-sizing:inherit">This means the function will compare the first 0 characters between the two strings. So it is equivalent to:<br style="box-sizing:inherit"><br style="box-sizing:inherit"><span style="box-sizing:inherit;font-weight:bold">strncmp("","",0)</span><br style="box-sizing:inherit"><br style="box-sizing:inherit">Of course, two 0 length strings are equal, so it wrongfully concludes the hashes are equal.<br style="box-sizing:inherit"><br style="box-sizing:inherit">What the programmer should have done is check if the hash coming from the browser has the correct length, 32 characters, before attempting to compare the two strings.<br style="box-sizing:inherit"><br style="box-sizing:inherit">Or even better, the programmer should have used the proper string comparing function, strcmp, that already does that for you and you don't need to supply a length parameter, like this:<br style="box-sizing:inherit"><br style="box-sizing:inherit"><span style="box-sizing:inherit;font-weight:bold">strcmp(string1, string2)</span><br style="box-sizing:inherit"><a class="gmail-postlink" href="http://www.cplusplus.com/reference/cstring/strcmp/" style="box-sizing:inherit;background-color:transparent;text-decoration-line:none;color:rgb(255,78,0)">http://www.cplusplus.com/reference/cstring/strcmp/</a></div></li></ul></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 8, 2017 at 8:32 PM, Rene Shuster <span dir="ltr"><<a href="mailto:rene.shuster@bcsemail.org" target="_blank">rene.shuster@bcsemail.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">In case you missed it: <a href="https://www.tenable.com/blog/rediscovering-the-intel-amt-vulnerability" target="_blank">https://www.tenable.com/blog/<wbr>rediscovering-the-intel-amt-<wbr>vulnerability</a><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Fri, May 5, 2017 at 8:10 AM, Peter Stuge <span dir="ltr"><<a href="mailto:peter@stuge.se" target="_blank">peter@stuge.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">First, thanks to everyone who is working hard to maintain a good tone<br>
on the list. I certainly appreciate that.<br>
<br>
While the ME and that it may have issues ;) is not so big news for many<br>
in this community, this is an important news story for IT in general,<br>
as it furthers the goal of platform and firmware openness.<br>
<br>
<br>
Sometimes I disagree strongly with Ron, but I think he makes a good<br>
point here:<br>
<span><br>
ron minnich wrote:<br>
> I realize feelings are strong about these issues, but calling<br>
> people and projects "corrupt" is unacceptable and, in my view<br>
> anyway, I'd like people who say such things to find another<br>
> project.  I watched the Plan 9 mailling list get destroyed by a few<br>
> bad actors and I don't want to see that happen here.<br>
<br>
</span>I don't think saying "corrupt" is neccessarily taboo, but the word<br>
needs to be used carefully, or you may just end up poisoning the<br>
community - *that* is unacceptable.<br>
<br>
I would like to take this opportunity to ask a favor of everyone<br>
in this community: Don't allow words to poison you too easily. Stay<br>
strong. I found this graphic very helpful:<br>
<br>
<a href="http://www.netbooknews.com/wp-content/2011/07/the-pyramid-of-debate-550x417.jpg" rel="noreferrer" target="_blank">http://www.netbooknews.com/wp-<wbr>content/2011/07/the-pyramid-of<wbr>-debate-550x417.jpg</a><br>
<br>
Don't fall down the pyramid, and don't let anyone else pull you down.<br>
<br>
<br>
It's easy to claim that someone else does the wrong<tm> thing even<br>
with good intentions, but you can extrapolate that someone is doing<br>
wrong<tm>, just because they seem to have good intentions.<br>
<br>
And keep in mind that while everyone in the coreboot community seeks<br>
open firmware more or less actively, some seek even more open platforms<br>
than others.<br>
<br>
As long as someone is investing in improving the firmware status quo,<br>
that is a good thing for all of us, even if the road becomes somewhat<br>
longer than we may like. It's not for me to say what someone else<br>
spends their time developing. I can disagree, and tell them, as they<br>
can with me, but I can't expect them to care.<br>
<br>
<br>
My personal attitude to Librem as far as an open laptop platform goes<br>
is that it's too little too late, but that that's not really through<br>
any fault of Puri.sm.<br>
<br>
Sure, I was disappointed by early communication with the company about<br>
the difficulties of the task they had set for themselves, and I agree<br>
that they have been underestimating the problem. I am guilty of that<br>
too at times. The question is what we do to better ourselves.<br>
<br>
Like Ron, I think it's great that Youness is joining the coreboot<br>
community! :)<br>
<span class="m_-7127474802593144264HOEnZb"><font color="#888888"><br>
<br>
//Peter<br>
</font></span><div class="m_-7127474802593144264HOEnZb"><div class="m_-7127474802593144264h5"><br>
--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="https://mail.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://mail.coreboot.org/mail<wbr>man/listinfo/coreboot</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><span class="">-- <br><div class="m_-7127474802593144264gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Tech III * AppControl * Endpoint Protection * Server Maintenance<br>Buncombe County Schools Technology Department Network Group<br><a href="http://comicsanscriminal.com" target="_blank">ComicSans Awareness Campaign</a></div></div></div></div></div></div>
</span></div>
<br>--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br>
<a href="https://mail.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://mail.coreboot.org/<wbr>mailman/listinfo/coreboot</a><br></blockquote></div><br></div>