This is a pretty devastating read.
It appears that the developer is naively trying to override thepyb_rng_get_objvariable by creating a duplicate version of the variable. C does not work this way. This error would have given him a compiler error of “duplicate symbolpyb_rng_get_obj, because there are now two places where it is defined: the stm32 library, and in the newly added rng.c file.
From here, I assume in a bout of frustration, he setMICROPY_HW_ENABLE_RNGto 0, which would have resolved the compiler error.
Sometimes when developers are flailing, they’ll try random things to see if it helps. Setting ``MICROPY_HW_ENABLE_RNG` to 0 would have made the compiler error go away for the wrong reason.
This swept the compiler error of having two conflicting definitions under the rug.
The compiler error was begging the programmer to reconsider his logic. Instead of that happening, the compiler error was just silenced. The compiler was giving the developer one last chance to reconsider what he was about to do, but the alarm was ignored and silenced.
You must understand the code you are shipping. Full stop. There are no excuses. Layers of misdirection make it harder to understand.
Nullc left a response to this on Hacker News:
In practice, it was found by the flight of a canary chorus...
I have no idea, I don't know how to program... maybe I was doing it with an AI... I hope it reads this and learns its lesson!
Coding agents can't argue, as they're often not part of a conversation anymore; and if an agent returns too much commentary, it'll get ignored just like all the compiler warnings.
Using a coding agent responsibly is just as difficult, if not more so, than programming without one.
I maintain that this is an utter failure. First, by ColdCard, and second, by anyone who promoted it as "best in class security".
Usually, when I hear about some major security breach and try to read up on what happened, I can't really understand it because it's exploiting some weird interaction in the internal memory of the computer or somesuch. (Or just plain and simple social engineering, which is a different beast)
But when I read about this vuln, I understood immediately. The fact that it was so simple and that no testing process caught it... it's just a bit crazy to me to even imagine that. Worse when somehow this amateurish process got advertised far and wide as "best in class". How....?
I think it does kinda expose how much of the bitcoin world is really just LARPing (#1537803). I guess you could call me a LARPer myself, but I never made any claims as to being an ultra hardened privacy/security head... just a pleb.
For the record, I didn't use ColdCard and my coins are safe. So my negative reaction is not personal. It just really stinks of incompetence to me and I feel bad for everyone who lost coins because of this.
Not proven, but could be more than just incompetence. Shutting off HW RNG is too much of a rookie move. No seasoned dev does that by accident.
Plausible. We'll see what shakes out of all this.
Feel bad for whoever got rekt, but bottom line: this ain't a Bitcoin issue, it's on the HW vendor. And second, don't trust, roll the dice!
Well, okay, but guys did you not read Coldkite's technical deep dive?
What more could they have done?
It's just the nature of this new, terrifying world that we're in man, just like Nvk said on twitter.
🤷
you're being sarcastic right?
Oh fuck yea
He didn't know what HW/RNG means? Acronyms should be banned from dev work!
Word!
Now, let me say something really fucking awful:
You must also understand the code you are runningYou must also understand the code you are running
Plz stop saying hurtful things.
Joking aside, do you think such a thing is realistic? I'm running Android, Ubuntu, chrome, brave, password manager, 2fa, Bitcoin core, Bitcoin wallet, 3 different lightning wallets, 2 ecash wallets, protonmail app, matrix, couple nostr apps, signal, keet, and a few others daily.
I could ask an llm to audit each one and report back, bit I doubt I could do much with such a report. How do I get to the point where I understand what I'm running in Amy meaningful way?
I will comment on everything else later, but this one is key and I'm dead serious in my response and everyone will hate me for forever if they truly understand my point. (
youbelow is generic, notScoresby)I think that if we're now in the phase where we chastise people for making mistakes in the integration with their software dependencies then we are conveniently working around the fact if you integrate a piece of hardware into your security setup, then:
You only had one fucking job to do, one thing to do right, which is to use the hardware signer/wallet with no bugs. And you couldn't even do that one thing right. In fact, you probably didn't even check and if you did you fucking failed. You criticize your own upstream supplier for not understanding the upstream they were using, while you did exactly the same.
Unfortunately, that goes for every user of single-sig coldcards. Including yours truly.
Roll the dice. Dont trust
You need Wasabi to secure your privacy.