TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Milk Sad Disclosure

136 pointsby dgrovealmost 2 years ago

13 comments

NelsonMinaralmost 2 years ago
&quot;On Libbitcoin Explorer 3.x versions, bx seed uses the Mersenne Twister pseudorandom number generator (PRNG) initialized with 32 bits of system time.&quot;<p>That&#x27;s a hell of an amateur mistake to make. 50&#x2F;50 odds whether it was incompetence or deliberate fraud. Maybe 80&#x2F;20; that flaw is so simple anyone can attack it. Which apparently is happening right now. It&#x27;s much better if your crypto library generates keys only you can hack.
评论 #37055664 未加载
评论 #37056907 未加载
评论 #37056203 未加载
评论 #37055955 未加载
评论 #37074675 未加载
评论 #37055424 未加载
评论 #37055454 未加载
lostmsualmost 2 years ago
Note: &quot;Libbitcoin&quot; here is a company name, and not a name of the core bitcoin library.<p>Only their products and whoever used them as a 3rd party is affected.
评论 #37057954 未加载
评论 #37056541 未加载
评论 #37055579 未加载
kmeisthaxalmost 2 years ago
Reminds me of attacks people were running on &#x27;brainwallets&#x27; a while back - i.e. wallets whose initial key material was just a passphrase you&#x27;d remember. The idea was that you could keep the passphrase stored <i>nowhere</i> and not have to worry about it being stolen by... well, any of the 10,000 things out there looking for cryptocurrency keys. Of course, there is no way in hell you can actually make the human brain store enough entropy perfectly, and once people realized that these wallets were crackable, they all got drained pretty quick.<p>Owning Bitcoin is like paying into an involuntary bug bounty program. Every time someone finds a bug, your life savings get wiped out.
评论 #37055481 未加载
评论 #37055749 未加载
评论 #37055480 未加载
评论 #37057735 未加载
评论 #37056169 未加载
RustyRussellalmost 2 years ago
Worth noting: libbitcoin is an obscure project with an impressive name.<p>In that it&#x27;s not used by bitcoind or any wallets I know of: it&#x27;s mainly of interest here because the book Mastering Bitcoin used it for examples.
评论 #37056591 未加载
评论 #37056714 未加载
评论 #37056966 未加载
TacticalCoderalmost 2 years ago
&gt; <a href="https:&#x2F;&#x2F;blog.ledger.com&#x2F;Funds-of-every-wallet-created-with-the-Trust-Wallet-browser-extension-could-have-been-stolen&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;blog.ledger.com&#x2F;Funds-of-every-wallet-created-with-t...</a><p>This &quot;Milk Sad&quot; was apparently discovered by the guys at Ledger (they make a hardware wallet but which can also be used as a U2F device for, say, SSH logins).<p>These guys are good. Their CTO (or ex-CTO ?) was part of the original FIDO alliance that came up with the U2F spec.
评论 #37073808 未加载
comexalmost 2 years ago
The spiciest bit:<p>&gt; During our accelerated coordinated disclosure to the Libbitcoin team, the Libbitcoin team quickly disputed the relevancy of our findings and the CVE assignment. By our understanding, they consider bx seed a command that should never be used productively by any bx user since it is sufficiently documented as unsuited for safe wallet generation.<p>&gt; We do not agree with this assessment.<p><a href="https:&#x2F;&#x2F;milksad.info&#x2F;disclosure.html#libbitcoin-vendor-response" rel="nofollow noreferrer">https:&#x2F;&#x2F;milksad.info&#x2F;disclosure.html#libbitcoin-vendor-respo...</a>
评论 #37059181 未加载
hashmushalmost 2 years ago
Seems a bit overkill with a brand + domain name for every new vulnerability.<p>Don&#x27;t get me wrong, it&#x27;s a nice find and all, but I&#x27;m really distracted by all the fluff.
评论 #37055132 未加载
评论 #37055734 未加载
mkjalmost 2 years ago
Was the code seeding by seconds since epoch, or nanoseconds since epoch truncated to 32 bits? Broken either way.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;libbitcoin&#x2F;libbitcoin-system&#x2F;blob&#x2F;a1b777fc51d9c04e0c7a1dec5cc746b82a6afe64&#x2F;src&#x2F;crypto&#x2F;pseudo_random.cpp#L70">https:&#x2F;&#x2F;github.com&#x2F;libbitcoin&#x2F;libbitcoin-system&#x2F;blob&#x2F;a1b777f...</a><p><pre><code> const auto now = high_resolution_clock::now(); return static_cast&lt;uint32_t&gt;(now.time_since_epoch().count());</code></pre>
评论 #37061595 未加载
tedunangstalmost 2 years ago
Weird. I&#x27;ve been assured, repeatedly, that time seeded PRNGs are never used for crypto and it&#x27;s not an issue worth addressing.
评论 #37056850 未加载
评论 #37056573 未加载
nullcalmost 2 years ago
Some extra relevant links:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;libbitcoin&#x2F;libbitcoin-system&#x2F;pull&#x2F;559">https:&#x2F;&#x2F;github.com&#x2F;libbitcoin&#x2F;libbitcoin-system&#x2F;pull&#x2F;559</a><p>The pull request adding the vulnerability, the lack of review or collaboration is worth noticing. The prior code was already dubious in that AFAIK std::random_device library doesn&#x27;t promise that the randomness is suitable for cryptography. I believe on common systems where this code was run the old code was not <i>likely</i> to be exploitable, but I wouldn&#x27;t bet my money on it.<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;evoskuil&#x2F;status&#x2F;1688657656620167169" rel="nofollow noreferrer">https:&#x2F;&#x2F;twitter.com&#x2F;evoskuil&#x2F;status&#x2F;1688657656620167169</a><p>Developer commentary on this issue. I can&#x27;t figure out what &quot;long-documented intended usage&quot; a seed command that mandates 128-bits of output but never has more than 32-bits of entropy would have.<p><a href="https:&#x2F;&#x2F;archive.is&#x2F;A7Jn6" rel="nofollow noreferrer">https:&#x2F;&#x2F;archive.is&#x2F;A7Jn6</a><p>The documentation the tweet references. I don&#x27;t know how the &#x27;Pseudorandom seeding&#x27; warning there would be distinguishable from warnings against CSPRNGs in favor of dice rolls or whatever, perhaps this is an example of the harm that chicken-little crying about CSPRNGS causes. Nor can I figure out for whose convenience this function would serve except attackers. In any case, this is the only place I found any kind of warning and the warning postdates the mastering bitcoin usage (as well as the change that made the command unconditionally unsafe).<p><a href="https:&#x2F;&#x2F;archive.is&#x2F;HDe8h" rel="nofollow noreferrer">https:&#x2F;&#x2F;archive.is&#x2F;HDe8h</a><p>Current libbitcoin-explorer instructions telling users to use the seed command to generate private keys.<p><a href="https:&#x2F;&#x2F;archive.is&#x2F;fhm5J#selection-12915.2-12915.10" rel="nofollow noreferrer">https:&#x2F;&#x2F;archive.is&#x2F;fhm5J#selection-12915.2-12915.10</a><p>Current libbitcoin-explorer instructions telling users to use the seed command to generate BIP39 seeds (also private keys).<p><a href="https:&#x2F;&#x2F;archive.is&#x2F;PWLKJ" rel="nofollow noreferrer">https:&#x2F;&#x2F;archive.is&#x2F;PWLKJ</a><p>Current libbitcoin-explorer documentation on randomness noting that bx seed is the ONLY source of randomness available to users in the package, and that all other commands that need randomness require the user to provide it. It also notes that &#x27;bx seed&#x27; will not function if less than 128-bits are requested.<p>The private key and bip39 seed usage (above) sure appears to be the &quot;intended usage&quot; in their documentation, but the &quot;bx seed&quot; function as currently implemented (since 2016) is unambiguously not fit for those purpose.
评论 #37058794 未加载
评论 #37057713 未加载
评论 #37058626 未加载
ryan-calmost 2 years ago
I wonder whether they modified brainflayer for brute forcing this, or if they wrote something from scratch.
评论 #37056016 未加载
efficaxalmost 2 years ago
lol just straight up not using a cryptographically secure source of randomness. that&#x27;s literally the first thing you do when you want secure cryptography. idiots
yieldcrvalmost 2 years ago
Are any of the following two things true:<p>Multi signature addresses mitigate this attack vector?<p>With the “taproot+schnoor” upgrade last year, it is impossible to tell if funds are stored in a single signature vs multi signature address?
评论 #37055223 未加载
评论 #37058848 未加载