6 ms·
Apparently the coding mistake was identified and deemed "impossible to exploit": https://certificate.quantstamp.com/full/nomad https://certificate.quantstamp.co
by bombcar 4y ago
Apparently the coding mistake was identified and deemed "impossible to exploit": https://certificate.quantstamp.com/full/nomad https://certificate.quantstamp.com/full/nomad
> QSP-19 Proving With An Empty Leaf
> Recommendation: Validate that the input of the function is not empty
> The Nomad team responded that "We consider it to be effectively impossible to find the preimage of the empty leaf".
> We believe the Nomad team has misunderstood the issue. It is not related to finding the pre-image of the empty bytes. Instead, it is about being able to prove that empty bytes are included in the tree (empty bytes are the default nodes of a sparse Merkle tree). Therefore, anyone can call the function with an empty leaf and update the status to be proven.
- deleted 4y ago[deleted]
- jxi 4y agoQuantstamp said it was exploitable. Nomad falsely claimed it wasn’t.
- mhluongo 4y agoThey're two distinct issues in two distinct contracts, AFAICT.
- treis 4y agoIt 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.
- 5350-uiop-1130 4y ago> routine upgrade yes, a routine upgrade. that's what it was..... (→_→)
- sieabahlpark 4y ago
- radicaldreamer 4y agoThe cofounder was involved in some drama with a CELO bridge not too long ago https://imgur.com/a/gV6s1Gw https://imgur.com/a/gV6s1Gw
- mhluongo 4y ago... 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.
- radicaldreamer 4y agoOh interesting! Seems like some heavy gaslighting by Celo then
- bombcar 4y agoAnyone 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 ...
- Bud 4y agoThere are several very interesting books about this, yes. Air disasters are fascinating to read about.
- danielvf 4y agoI don't think this is the same issue as the exploit. The real issue was half-caught in a review on a pull request however. https://github.com/nomad-xyz/monorepo/pull/289/files https://github.com/nomad-xyz/monorepo/pull/289/files If this legacy enum value had been handled later in the code, there would not have been a vulnerability. (This isn't to say that the developers were bad. The person who wrote the code was extremely knowledgeable. It's just really hard to be perfect every time. )
- bigcat12345678 4y agoNo, they are bad. They are bad because they are not competent to write the decent code required by their profession and job environment. In normal software writing trade, such engineers are called low performers and routinely managed out of any organization. Sure, the mistake is not unusual from the perspective of general software engineering. But let's not forget what software they are working on. I am totally fine with a bartender dropping a glass... I'll put a surgeon on trial if he cannot make his hands steady during a heart surgery...
- fennecfoxy 4y agoLmao, people make mistake dude. Because they're human. What is seen here is a failure of multiple people, an organisation. I remember AWS S3 went down in 2017 or so and the key point I took away from their article about it was that they didn't blame the junior dev that caused it, because it shouldn't have been able to happen in the first place. Ah here we are: https://aws.amazon.com/message/41926/ https://aws.amazon.com/message/41926/ "We are making several changes as a result of this operational event..." basically boiling down to "the employee in question is not at fault because our tools should not have let him do that".
- mhluongo 4y agoEven excellent devs make security mistakes. That's why good teams build out processes like auditing, fuzzing, heuristics checkers, and require internal peer review. This "you must be perfect" mentality is detrimental to building a security culture, IMO — no one is perfect, and the most excellent dev will slip up. Seeing the people involved in that commit, I believe that's what happened here. Hoping we learn more in the post-mortem, and they revise their practices to catch this mistake in the future.
- drog 4y agoThat's common misinformation. The issue discussed in the review has no connection to what happened, and the narrative that it is the same issue, but it became exploitable after the update is incorrect too. It affects different part of smart-contract logic. Yes, it's pretty close at a glance—because you have zero-by-default problem somewhere close to Merkle tree.