Mikko Ohtamaa ๐Ÿฎ Profile picture
Feb 5 โ€ข 34 tweets โ€ข 8 min read
1/ Is #Solana going down to a hole?

Let's look at the causes of the Wormhole hack and what we can learn from this.

Let's discuss Solana security.

A thread.

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
2/ One of Solana's bridges, Wormhole, got hacked for ~120k ETH earlier this week.

coindesk.com/markets/2022/0โ€ฆ

The amount of US dollar value at risk, or lost, at this point, is $200-300M.
3/ A bridge is a blockchain application that bridges value between two blockchains together.

In this case, Wormhole was bridging ETH from Ethereum Mainnet to Solana.
4/ A good overview on bridges is in this @_prestwich's presentation "Building bridges, not wallet gardens"

5/ I believe this sets the hack the second most successful DeFi hack over history. Note that centralised exchange hacks like MtGox, Thodex, BitFinex, BitMart might be bigger.
6/ To establish the root cause, let's look at technical analysis first.

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
7/ The hack focuses on Solana smart contract programming concept called Sysvar Instructions

docs.rs/solana-programโ€ฆ
8/ @KudelskiSec has a detailed and friendly run down in their blog. Even software developers that do not possess Solana or #rustlang experience can follow the line of thought

research.kudelskisecurity.com/2022/02/03/quiโ€ฆ
9/ The Solana #rustlang toolkit function load_instructions_at was deprecated October 2021 in this commit:
11/ The commit replaces the with the safe load_instruction_at_checked() variant. because the issue was already well known by October 2021

Here is also the relevant Solana programming documentation

docs.solana.com/developing/proโ€ฆ
12/ (Note that when you deprecate something, also rename the old function as unsafe_() per secure defaults rule)

See PyYAML incident

blog.ankursundara.com/pyyaml-cve/
13/ Thus, the root cause of the incident be broken down to

- Designing an unsafe API (Solana "developer experience" mistake)
- Using this unsafe API (Wormhole team)
- Not notifying the Wormhole team about the potential upcoming incident (Solana security team)
14/ Aftermath.

Is Solana insecure?

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡

A risk registry is a tool that TradFi fintechs use to classify risks and create risk matrix for regulators about their business.
15/ In your business there exist

- Inherited risk, due to the nature of business
- Mitigations
- Residual risk after mitigations
16/ In Solana's case inherited risk comes due to use of novel blockchain technology and Linus Tolvard's law of eyeballs:

"Given enough eyeballs, all bugs are shallow"

(Linus from #Linux fame).
17/ This means that more developers you have, over time, all bugs will be found in an #opensource code base and none are left.
18/ Solana has not had enough time and developers have yet to become mature e.g. Ethereum, which had a headstart since 2014.

There exists more code that needs more eyeballs to read it.
19/ This is the nature of the software: only time can produce mature software, nothing else. Solana devs cannot speed up time. The inherited risk will be there for a few more years at least: Solana is new - it will have issues with a new product.
20/ This leaves us mitigations to bring down the inherited risk.

Mitigations are happening, we can see load_instruction_at() -> load_instruction_at_checked() commit was done in October 2021.
21/ But are mitigations enough and how can they be improved?

I do not know the details of the Solana security researcher scene, I have only familiarity with Bitcoin/Ethereum auditors and security research.
22/ Ethereum has private chat rooms where security researchers can discuss and alert each other with some implied assumed privacy (though this assumption is simply so called gentlemen's agreement.)
23/ Such a group could have alerted Wormhole team of vulnerable code in Nov-Dec 2021 and prevented the issue.

If such a Solana security chat group exists please invite me in.
24/ Solana will definitely learn from this incident.
25/ Aftermath #2.

Shitting on Solana and Jump Trading.

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
26/ Jump Trading, a very rich Chicago based HFT firm, owns Certus One, the developer of Wormhole (I did not verify this.)

They gapped the missing 120k ETH from their own balance sheet.
27/ What else could they have done? This is the only move to signal that they are committed and adults who clean after their own mess.
28/ Coinbase did a similar move in 2017 and reimbursed traders in a flash crash.

techcrunch.com/2017/06/24/coiโ€ฆ

This ensured the traders can trust Coinbase (though I disagree giving people back money of losing trades does not set a good precedence.)
29/ Certus One did not do anything especially bad from the engineering standpoint. Solana devs are good as Ethereum devs.
30/ While I am all about shitting on borderline scam projects like Wonderland and their criminal founders, Wormhole or Solana are not such a project.
31/ Risks cannot be totally got rid of. Risks will realise. In the contemporary blockchain business, unlike in 2017 when Ethereum was going through similar issues, stakes are higher.

High stakes mean there will be higher losses, now and then.
32/ Also, because the issue was a smart contract bug, a similar incident can happen to L2s, though the inherited risk is lower. I bet my left kidney at least one L2 will blow up in 2022-2024 in a similar fashion.
33/ FIN

Now up to the mountain hiking trail to clean it up from trash.
Ps. On secure defaults: #Ethereum ERC-20 approve() / transferFrom() should be renamed to

unsafeApprove() and unsafeTransferFrom()

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Mikko Ohtamaa ๐Ÿฎ

Mikko Ohtamaa ๐Ÿฎ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @moo9000

Jan 21
1/ 1/ The short history of Web3.

It is going to be a really short thread, the #DeFi historian promises.

Also, any reader will also become a prolific #javascript developer after reading this.

Storytime.

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
2/ Web3 originally meant three different APIs injected to web context. This was circa 2015-2016.

Web = web context
3 = three different APIs

Web + 3 = web3.

But what does this mean?
3/ API stands for Application Programming Interface. It tells how applications (developed by a software developer) can communicate with other applications that they have not developed themselves.

For example, how your wallet can communicate with #Ethereum is defined by API.
Read 17 tweets
Oct 15, 2021
1/ HOW YOUR CRYPTO FUND OR EXCHANGE GETS HACKED

In the light of the recent event of a prop trading firm losing big monies in an old-fashioned Microsoft Word attachment attack, let me sip my tea and try to remember what kind of hacks I have seen over the years.

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
2/ I will skip all retail-focused attacks, like fake websites and weak passwords and only focus on serious cases where tanotable business pitself was a victim.
3/ Also no talk about SIM swapping etc. as it is the US only problem and only possible because the US does not have strong ids issued by the government (don't live in a crap nation plz.)
Read 33 tweets
Sep 21, 2021
1/ LET'S LAUNDER SOME CRYPTO.

So you pulled off a successful blackhat hack, or you just happen to run a profitable ransomware operation. How to convert your profits to Lambos?

Let the daddy godfather @moo9000 to tell you, a thread.

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
2/ This is in the light of the the recent OFAC notice against Suex (on paper in Prague, in practice in Russia) money-laundering front. They laundered BTC for the ransomware gangs.
3/ Read this excellent fresh post by @trmlabs on the topic

trmlabs.com/post/ofac-takeโ€ฆ
Read 45 tweets
Sep 15, 2021
1/ THE TALES OF BLOCKCHAIN FAILURES

A Twitter novel

Who? When? Why?

Keep reading ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
2/ Solana was down yesterday, Arbitrum was "down" as well.

Salty maxis crawled out from the caves shouting "#Bitcoin is never down" "#Ethereum is never down" "#IOTA is never down"

Technically they are not correct.
3/ So let's look at all the bad things that happened with the blockchain networks as a whole in history.
Read 34 tweets
Sep 14, 2021
KB-96542804 How to turn a blockchain off and on again Image
To be honest, this process is not different I have seen on some other chains and during the EOS launch party.

1) Verify state and software version

2) Choose what chain to follow Image
What makes it interesting is slashing etc. and what happens with penalties for validators.

While events like this have happened before for chains, and many testnets, I do think the scale of this event sets a precendence.
Read 10 tweets
Sep 6, 2021
1/ Climate activist arrested after ProtonMail discloses the IP address.

An interesting case for privacy and why this is significant: A decentralisation and #infosec thread.

Put on your Guy Fawkes masks now.

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
2/ "@ProtonMail received a legal request from Europol through Swiss authorities to provide information about Youth for Climate action in Paris, they provided the IP address and information on the type of device used to the police"
3/ The HackerNews discussion here

news.ycombinator.com/item?id=284272โ€ฆ
Read 26 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

:(