-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bx seed
warning can be ignored
#728
Comments
Examples with hardcoded entropy are slightly less secure than using the existing bx seed when copied verbatim, which is sadly likely. The documentation updates should be sufficient (IMO). Maybe instead bx seed should output a fixed seed random number to illustrate even to developers that don't read about it that it can't be secure? |
It does suck to lose the convenience of it for demos, and the risk will now shift to copy/paste of constants. But that’s probably lesser and also eliminates risk of existing poor/dated third party documentation. A fixed seed output may not actually be noticed. |
Why couldn't the |
We removed all references to OS entropy, as they cannot be secured. Retaining it for this one command would serve no purpose but to imply it was somehow safe (and people would presumably also have used it for live seeding). We instead reused the pseudorandom class from libbitcoin-system for demo seeding. This class exists for support of other library systems that do not require true randomness, which is the same requirement for demo seeding. |
What specifically is meant by "secure" in this context? |
Guarded against injection. Both the hardware and OS can be manipulated. When accepting a seed from the OS there is no way for a user to ensure this is not the case. By rolling dice (for example) the user can at least prove whether a given platform has altered a resulting key by performing the same key generation on one or more other machines using the same dice entropy. This is not possible when trusting the OS. We made the decision years ago to remove all use of rand() for this reason. It was not acceptable to embed trust in the platform. This is the reason people roll dice. Trusting the OS is unsecurable. There is no way to measure how insecure it is at any given time, or to predict when widespread exploits in hardware generators or OS builds may occur. But the more Bitcoin value that is out there, the greater is the bounty for such attacks. There could also be state-level targeted attacks, as we are well aware that these do in fact occur. |
I'm not sure I understand the threat model. If the hardware or kernel is compromised then any user-space software is also compromised. That invalidates all cryptographic software ever written, including all software wallets, exchanges, miners, and any software deployed for mission critical security applications, e.g. financial institutions and certificate authorities. It's a nuclear assumption. Someone could have an air gapped machine with a verified kernel and hardware. Why's it assumed all systems are untrustworthy, can't users decide for themselves whether they trust their own systems?
Don't you think providing a OS random is widely trusted to be a reasonably good cryptographic randomness source. Using it would've protected users from misuse while having no impact on the tool's use as a demo. Someone who doesn't trust their system would've "rolled dice" anyways and so wouldn't be affected by any particular implementation. Who benefited from weak randomness being used here? Removing the command now is sensible, though originally calling it |
The command is not “insecure”, it is not for live wallet use. There is a difference. Using it as documented presents no security issue. It is not true that since a platform can be compromised one might as well accept any seed the platform may provide. A platform’s trustworthiness for entropy cannot be determined, but your own entropy can be trusted, and as I previously pointed out, its uncorrupted use can be verified. This is why we do not accept platform seeds. The fact that others may accept such insecurity is their issue. This is not a proper forum to second guess what might have been done differently. Please take this to the slack channel or mailing list if you find that interesting. |
|
Shared a patch on slack to remove bx seed references from the libbitcoin-explorer wiki. Once that is pushed, we need to
|
Quote from today in libbitcoin-explorer wiki
Insecure. Also in the bitcoin wiki up to 9 August 2023 the version created by you on 12 July 2015 you in Bitcoin wiki:
Insecure. The commit which made all hacked hackable was done on 21 Oct 2016. Also the commit to Mastering Bitcoin book using The timeline...
How you can blame Mastering Bitcoin book and Bitcoin wiki where you yourself made the edits? What are other places where you or others promoted the use of Then also bitcoin.stackexchange.com has a many answers with examples using Nice commentary by @gmaxwell in If you used "bx seed" you probably already lost your bitcoins, but if...:
|
Greg has always had an ax to grind here - and is a widely-reputed sock puppeteer, so this sock puppet account quoting his theory may just as well be him. He probably never advocated that key security should be “maybe secure” or “usually secure”, or dismissed “theoretical security problems” before this, but here he is promoting that condition when it serves to support his theory in the service of maligning Libbitcoin. |
How about you address the content rather than personal stuff? |
I see no problem with addressing both at once, as I did. |
Since release 3.7.0 had been previously defined in source (but not tagged for release), it could have led to misinterpretation of the version with |
@kulpreet has updated the bx documentation (wiki). All examples of the seed command have been replaced with |
The following notice has been posted to Slack and the libbitcoin email list:
This completes the actions described above. |
A full report has been posted, with inputs from @evoskuil, @pmienk, @kulpreet, and @thecodefactory. Links have been issued through Slack, Listserv, and Twitter. |
Thanks for the full report, I must say I can only salute the professionalism in the response from the Libbitcoin maintenance team. I had an in-depth look at the milk.sad disclosure by their core team (Distrust + Independent) when it was published during the summer of 2023. Reading it, at the time I echoed my concern in private to few other experts on the technical motivation behind libbitcoin-system’s PR 559. If I remember correctly I voiced concern on naively using system pseudo random function. I was unaware that PR 559 which is hardening pseudo-random number generation came from ground reports on the Libbitcoin mailing list. On the lack of redundant documentation in matters of cryptographic / secure API, I can only say this is a common weakness of many large-scale open-source projects (Bitcoin Core included), so I don’t think this is something which can be put on the discredit of Libbitcoin. Distinction between CSPRNG and PRNG is somehow known since the ~2000s in security literature, so if you’re designing a key-management system for production entreprise, you certainly will read twice or three times the randomness generation flow. As it’s underscored in your full report, this is more likely that the friends or professional connections of the milk.sad
Finally, I can only share the expressed opinion on the apparent conflict of interests by the milk.sad group of authors. When you’re publishing a vulnerability as a full disclosure, I think one ethical rule from the decades-old infosec tradition is to decently segregate your open-source and commercial interests. Certainly not attaching a “please hire me” for commercial work at the end of a full-write up public disclosure report, and I’m speaking with a lot of experience... |
Thanks for the taking the time to provide this feedback @ariard |
I suggest just removing the command, as users may not bother to read or understand even explicit warnings. This precludes its future unsafe use even based on external documentation outside of our control.
Removal consists of marking the command as obsolete in the commands xml and regenerating. Related /src and /test sources may then be removable (verify based on other obsoleted commands).
This requires that all documentation examples (wiki) be updated to use hardwired entropy data. This alone may result in people using that data to create a live wallet. So documentation for commands that accept entropy should provide a warning to provide your own true entropy for live wallet usage (such commands should already have similar help). This amounts to the same type of documentation that existed for
seed
but will instead be spread across each entropy-accepting command.Published bx binaries should be removed and a notice sent out via the libbitcoin slack and mailing list with the breaking change (obsoletion) announcement. Minor (middle) version number should be bumped in the build xml, with artifact regeneration after command are updated.
The text was updated successfully, but these errors were encountered: