News for hackers. Stuff that matters.
Re:Nomad drained of $150m due to a coding mistake by treis on Tuesday August 02, 2022 @11:14AM (#32319597)
It seems like it was (at least arguably) impossible to exploit until they introduced a second issue:

>It turns out that during a routine upgrade, the Nomad team initialized the trusted root to be 0x00. To be clear, using zero values as initialization values is a common practice. Unfortunately, in this case it had a tiny side effect of auto-proving every message

EDIT:

Reading and noodling I'm 99% sure these are separate issues. The vulnerability talks about passing in an empty leaf to the prove function. But that's not what the exploit is.

The exploit is using an unproven message. So they are passing in an actual leaf to prove. The problem is that unproven messages have 0x00 as root and some jabroni set 0x00 as the trusted root. So every message was treated as proven by default when it should be the opposite.

Re:Nomad drained of $150m due to a coding mistake by bombcar on Tuesday August 02, 2022 @12:04PM (#32320472)
Anyone who's studied NTSB reports knows this is almost always how they go; a single failure that is no problem becomes one because of some other issue that doesn't normally happen, or couldn't happen because normally a third thing is always done ...
Re:Nomad drained of $150m due to a coding mistake by stouset on Tuesday August 02, 2022 @02:21PM (#32322425)
Same with tons of security incidents in general. It's the "swiss cheese model" (https://en.wikipedia.org/wiki/Swiss_cheese_model).
Re:Nomad drained of $150m due to a coding mistake by adhesive_wombat on Tuesday August 02, 2022 @05:38PM (#32324591)
And when it becomes organisationally normalised that one layer of safety isn't working and the remaining ones are relied upon, then that's more like the subject of Normal Accidents [1]

[1]: https://en.wikipedia.org/wiki/Normal_Accidents

Re:Nomad drained of $150m due to a coding mistake by Bud on Tuesday August 02, 2022 @01:21PM (#32321632)
There are several very interesting books about this, yes. Air disasters are fascinating to read about.
Re:Nomad drained of $150m due to a coding mistake by brazzy on Tuesday August 02, 2022 @04:55PM (#32324186)
A series of very good, detailed article about air disasters over on Reddit: https://www.reddit.com/r/AdmiralCloudberg/comments/e6n80m/pl...
Re:Nomad drained of $150m due to a coding mistake by imtringued on Wednesday August 03, 2022 @05:02AM (#32329327)
Stable systems don't break because something went wrong, they break because everything went wrong.
Re:Nomad drained of $150m due to a coding mistake by klodolph on Tuesday August 02, 2022 @01:45PM (#32321970)
I'm not completely sure the mechanics of this exploit, but I've recently adopted the personal guideline of "all enums and integer IDs start at 1", and 0 is simply an invalid value.

Not a hard and fast rule, and not something that will catch tons of problems, but now and again it does help me catch an uninitialized value.

Re:Nomad drained of $150m due to a coding mistake by fsckboy on Tuesday August 02, 2022 @02:54PM (#32322801)
> "all enums and integer IDs start at 1"

then whoever takes over maintenance from you and wants to make improvements says "hey, we can add this new v2 feature through the 0x0 which is available for future enhancements"

Re:Nomad drained of $150m due to a coding mistake by klodolph on Tuesday August 02, 2022 @03:06PM (#32322938)
Unlikely. The way it works is you define your enums like this:

  enum class Color {
    Invalid, // Not a valid value.
    Red,
    Orange,
    Yellow,
    Green,
  };
I think if someone's crazy enough to reclaim a 0 value in an enum or integer ID, then they're probably going to do a lot of damage to the code no matter what you do.
Re:Nomad drained of $150m due to a coding mistake by benreesman on Tuesday August 02, 2022 @06:17PM (#32324972)
Yeah, pretty much every integer enum I write has `UNKNOWN` or `INVALID` as the zero value. It adds either a `case` or a `default` to every switch and a clause or a `_` to every `match`, but it saves my ass even in non-security-sensitive settings.
Re:Nomad drained of $150m due to a coding mistake by seanhunter on Wednesday August 03, 2022 @01:01AM (#32327834)
That wouldn’t work in situations like this unfortunately. In the ethereum ecosystem the 0x0 address has a special meaning because it is used as the origin of things on chain when they are newly created (they are transferred from 0x0) and often also the destination of things when you want to destroy them (you “burn” something by transferring it to 0x0).

Fun part is as far as I understand this is just a convention and there is nothing intrinsic to 0x0 that makes it different from any other destination address. If someone was to find the private key for which 0x0 is the public half they would have access to a vast amount of stuff that has been transferred there over time. Finding this key is computationally unfeasible however.

Re:Nomad drained of $150m due to a coding mistake by klodolph on Wednesday August 03, 2022 @08:30PM (#32338006)
Why wouldn’t it work here? Couldn’t you just as easily use address 1 or all ones for the same purpose?
Re:Nomad drained of $150m due to a coding mistake by tlb on Tuesday August 02, 2022 @02:01PM (#32322169)
Or use bigger numbers, so enums that get mixed up somehow won’t work.
Re:Nomad drained of $150m due to a coding mistake by mouzogu on Tuesday August 02, 2022 @11:32AM (#32319914)
> routine upgrade

yes, a routine upgrade. that's what it was..... (→_→)

Re:Nomad drained of $150m due to a coding mistake by radicaldreamer on Tuesday August 02, 2022 @01:07PM (#32321400)
The cofounder was involved in some drama with a CELO bridge not too long ago

https://imgur.com/a/gV6s1Gw

Re:Nomad drained of $150m due to a coding mistake by mhluongo on Tuesday August 02, 2022 @01:23PM (#32321658)
... that he also founded and planned to spin out with Celo, yes. James is the inventor of Optics, the cross-chain communication technique Nomad uses.

Very unhappy with how Celo handled the situation, as was much of the technical crypto community at the time.

Re:Nomad drained of $150m due to a coding mistake by radicaldreamer on Tuesday August 02, 2022 @01:35PM (#32321828)
Oh interesting! Seems like some heavy gaslighting by Celo then