Tay 💖 Profile picture
Sep 19, 2020 43 tweets 14 min read Read on X
Oooh fun one. Okay so let's start with literally MetaMask. Meaning your actual legit MetaMask extension is actually used in order to get the keys, rather than the keys that you generated with MetaMask or use in MetaMask are compromised without MetaMask involvement.
1. Attacker gets physical access to your device.

e.g. Evil maid attack. Theft. Leaving it unlocked at starbucks.

MetaMask takes measures in how they store secrets + auto lock state. But honestly if someone targeting you and your crypto gets your physical device, RIP. ☠️⚰️🥀
2. Full remote access to your device.

Most commonly, Teamviewer. Hacker walks thru the door you left open & grabs your shit.

Here's an old example of exactly that. Bonus insights into securing a product like MetaMask/MyCrypto/MEW in full reddit thread.

3. 0-day in OS or browser that allows access to memory, keyboard, chrome storage, etc.

Like zdnet.com/article/google… that targets your crypto and/or MetaMask.

While it's rare to see super sophisticated 0-days go for crypto, it's not unheard of. See link.medium.com/j4Nvhmw4T9
3b. It should be noted that it's not that 0-days *won't* go for crypto. It's just that historically they have had other fish to fry.

But you know...North Korea is a thing and they fucking love crypto.

google.com/search?q=lazar…
4. Malware or other not 0-day stuff that either targets your Metamask or crypto/secrets in general/clipboard or keyboard or something. But that's slightly out of scope for "literally your Metamask" and pretty uninteresting. Pro-tip: don't limewire porn, kids.
5. Far more interesting is a vulnerability in MetaMask rather than chrome storage or memory. The aforementioned malware, if targeting MetaMask specifically, would take advantage of this...if it existed.
5b. Since a vulnerability that leaks MM seeds has never existed as far as I know...we must look elsewhere for what it may look like.

(Ps: @danfinlay have there ever been any leaky vulns that weren't exploited, were disclosed responsibly, or in the very early days?)
5c. Password managers are the most obvious place to look as they are full of secrets, widely used and really sophisticated security researches go after them.

Here is a good article with tons of links to vulns in various pw managers over the years

zdnet.com/article/critic…
5d. Note: you are better off using a pw manager than not. Most, if not all, the scary articles about their vulns are from security researchers, NOT exploits in the wild.

Do not delete your pw manager (but maybe don't put your single signer admin of the defi treasury key there.)
5e. Okay. Most of the pw manager exploits 1) access plaintext pws in memory 2) single secret leaks to unauthorized sites.

The former is something that could happen w MM. That's why the lock exists. Your seed is (double) encrypted in storage but you decrypt to send. That's in mem
5f. The later, credential leaks, don't apply as MetaMask never sends or inserts into the dom or even typically displays your seed or keys. There's no "give this dapp my key" function in MM like there is in a pw manager.
5g. I consider this type of vuln to be unlikely on a day-to-day basis but 50/50 chance we see one in the next 18 months. It would be quickly discovered and mitigated if in the wild and it's most likely to be discovered and disclosed by sec researcher before exploited.
5h. This should scare you I suppose but it's INSANELY LOW on my list of ways youll realistically have your crypto fucked out of you. Like maybe a <1% chance.

Mostly bc there's 1000 other ways to take your crypto that require less effort, no skill, and can't be patched in <24hrs.
6a. Malicious code pushed by fake "MetaMask team" to legit MM extension.

The fact this hasn't yet occured and MM has had 1m+ active installs since 2017 means it's not likely to occur. Testament to teams security mindedness. Ways it could occur:
6b. Most likely is the compromise of admin credentials of thing where code is. GitHub. Google Extension store thing. The thing that builds or signs the code prior to giving it to google. Etc.

Individuals who add code to MetaMask but don't admin it could be compromised but...
6c. ...it's relatively easy to mitigate by protecting branches, reviewing PRs, etc. Basically: don't let random people force push to master. Don't let master get to google without reviewing code and commits within master.
7. Slightly diff is malicious code being snuck into the codebase by outside maintainer. Again, easy to mitigate and MM has and will continue to do.

If anyone has a good link to someone attempting to sneak in code, plz share. There was an attempt once on MEW but I can't find it.
8. Most terrifying but not that likely but totally possible and fucking hard as fuck to truly mitigate is the compromise of fucking dependencies that are ultimately included in the MM codebase, unbeknownst to anyone.

Seriously just FUCK this type of attack.
8b. Typically known as "supply chain attacks" it does happen and it does happen against crypto companies!!! When they do happen in the wild, the security community goes nuts bc the attack is most often theoretical (and hard to mitigate). One example is kaspersky.com/blog/copay-sup…
8c. More on the attack in general: blog.acolyer.org/2019/09/30/sma…

These are both npm examples, but there have been ones in the wild for python's pip as well.
8d. But hey. If there's literally anyone who could be fucked by this one but maybe wont, it's literally MetaMask. Why? Theyve been building an epic next-level thing called LavaMoat to address this attack vector for the last few years. 🤯

8e. It's seriously epic. (and there's more resources and examples in their readme too.) github.com/LavaMoat/LavaM… Image
8f. Oops forgot about this one from June 2019 which really emphasizes how deep these dep roots go.

Add dep electron notify to easydex > add easydex as dep of Agama wallet -> add malicious code to electron notify

blog.npmjs.org/post/185397814…
8e. Amazingly, after spending months orchestrating & pushing good code to sneak in bad code...he sent the keys to a publicly accessible server.

So the wallet devs were able to white-hat 90% of funds..using the seeds on the hackers public box. 🙃

komodoplatform.com/update-agama-v…
9. Slightly diff is same attack but entry occurs thru a compromised thing you've put in your app / on your site. Recently a Moonpay endpoint on cloudflare was compromised to add malicious code targeting Iota's desktop wallet.

blog.iota.org/trinity-attack…

(really good post mortem!)
9b. It was patched by...wait for it...not letting a third party url serve you code that your app then runs willy-nilly. No one else who used Moonpay was affected bc none of them served the necessary lib thru a url.

It was also patched by pausing Iota. You know. 🤷
9c. Exchange Gate.io was compromised when hacker compromise StatCounter–analytics provider used by https://t.co/5vX3gQyOjb and 2m (!?) others)

Only https://t.co/5vX3gQyOjb was targeted. The script replaced BTC addresses on withdraw page.

welivesecurity.com/2018/11/06/sup…
9d. Being a dapp doesn't make you immune. Here's the version of an injection attack:

EtherDelta loads erc-20 tokens
Token contracts have token's name
EtherDelta gets name from chain to show user
Contract's name is actually code to steal users' keys

medium.com/@zhongqiangc/c…
9e. And neither does being a crypto exchange adding shitcoins willy nilly a la cryptsy + lucky7coin.

github.com/alerj78/lucky7…

These really aren't issues for MetaMask but they could be. But MetaMask avoids these easily.
10. Last one for now is KEY DERIVATION. Again, like the above, MetaMask *could* be affected by this but *isn't.*

Any wallet can (and many have) derived mismatched pub/priv keys. Usually bc pks are assumed to be 32 bytes but they are 31 bytes 1/128 (or 1/256?) times.
Here's all you need to know about cryptography to understand this.

12/24 word seed phrase + fancy math + dpath = private key

pk + fancy math = public key

public key + fancy math = address

Alls swell so long as you DON'T FUCK UP THE FANCY MATH
2015 (reported originally by @ricmoo of ethers-js) reddit.com/r/ethereum/com…

+ lightwallet in '16
github.com/ConsenSys/eth-…

bc bitpay was wrong
github.com/bitpay/bitcore…

+ ian coleman in '17
github.com/iancoleman/bip…

bc bitpay/copay didnt fix that thing in '16
github.com/bitpay/copay/i…
To know if your app is affected (either in gen or importing) here's test keys that are < 32 bytes:
github.com/Gustav-Simonss…

and
radar blur cabbage chef fix engine embark joy scheme fiction master release
on m/44'/60'/0'/0
should be
0xac39b311dceb2a4b2f5d8461c1cdaf756f4f7ae9
To complicate things, 12/24 word seed phrases have an add'l step where zeros may be dropped. If fancy math is diff across libs, it results in diff addresses being shown.

This DOES NOT result in *actual* loss like it does if in private -> public step.
MetaMask and lightwallet figured this out in '16. And reported to bitpay. Who didn't fix it. 🤦‍♀️

github.com/MetaMask/metam…

medium.com/@alexberegszas…

github.com/bitpay/bitcore…
The easiest way to not be the victim of this bug is to always send funds in AND out of a wallet before loading it up with your life savings. If you can successfully send out today, you will be tomorrow, even if its a bitch to do so.
The other way keys can be poorly derived is by not using enough entropy. Not enough entropy = private keys "mined" or brute-forced.

Ethereum has avoided randomness issues in keys, mostly bc devices + underlying crypto methods were better and more trusted when Ethereum launched.
2015

reddit.com/r/Bitcoin/comm…

> random.org started enforcing HTTPS
> returns "301"
> the entropy has actually been the error message not a random number meaning everyone affected got the key for
1Bn9ReEocMG1WEW1qYjuDrdFzEFFDCq43F 😬
Another Iota wallet was also affected by not-enough-entropy.

In 2018.

saturn.network/blog/iota-hack…

This is due to Iota rolling their own crypto and so wallets rolled their own crypto and...just dont.
The other way to not have enough entropy is if users can choose their key.

Brain wallets are bad. Period. @ryancdotorg is the expert: allprivatekeys.com/brain-wallet

Ethereum has luckily mostly avoided this except that one time Roman argued with Ryan lolol gitter.im/ethereum/gener…
You will always underestimate users. Always. Always. Do not let them generate or unlock low entropy shit. If they can, they will, and they will lose. Just like the guy who used private key 00000....000001. 🤦‍♀️

github.com/MyEtherWallet/…
I'll leave you w/ this.

Keys have to enter memory to sign a transaction and your memory is ultimately not safe IF there is a high enough incentive to get it.

MetaMask is your daily driver, NOT your life savings. It's safe to a point. Paper is your fren.

Image

• • •

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

Keep Current with Tay 💖

Tay 💖 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 @tayvano_

Dec 22
DPRK's trading career is...uh....going.....🙈

tbh if i was the dude managing Hyperliquid's 4 validators (or those fucking ghetto ass binaries on gh) I would be shitting my pants right now.

Hyperliquid dudes dont seem worried at all though so im sure its fine. 🫠 Image
lol @ all you retards who think the risk is USG forcing Hyperliquid to freeze AAAAAAAAAAHHAHAHHHAHAHAHAHAHAHHAHHAHAHHAHAHHAHAHAHAHHAHAHHAHAHHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHAHHAHAHAHAHAHAAHAHHAHAHAHHAHAHAHHAHAHAHA

Yall, DPRK doesn't trade. DPRK tests.🤦‍♀️
my offer from 2 weeks ago still stands @HyperliquidX

i'm still happy to do it async or via a call. i can even give you one of my super nice happy colleagues if you don't like me.

but a massive amt of harm will come to people if you don't harden your ass asap. Image
Read 4 tweets
Nov 16
Gotta correct the record on a headline that's been running wild lately re: the WazirX hack.

Bc it is NOT significant. Or a "breakthrough."

Dude they arrested wasnt involved in the hack. He doesnt know the hackers.

Plz stop regurgitating self-aggrandizing press releases. Image
Here's the actual situation:

At some point prior to July 2024 the actual hackers landed a backdoor onto something that gave them some access to the WazirX multisig signers and/or their signatures.

We don't know what or who was compromised and it doesn't really matter.
Initial toehold was likely gained by tricking someone at WazirX or Liminal into installing malware -> escalated from there.

This access allowed the hackers to intercept/insert invisible, malicious payloads for signing in a way where none of the 3+ signers were able to notice.
Read 21 tweets
Oct 20
With the recent sophisticated hacks fresh on everyone's mind, there's been a lot of talk about ✨fancy stacks and setups.✨

Yes, you should evaluate how—and with what—you sign txns.

But building a custom UI for your LAN Qubes OS AWS KMS everyday is not really the answer 😅
Background on the referenced hacks (feel free to skip):

1. Funds were stolen from each org's multisig.

2. Keys themselves were not compromised.

3. In Radiant and WazirX and maybe DMM, the keys backing the multisig were actually only on hardware wallets + actually controlled by distinct parties.

Radiant - $50m, like 2 days ago
medium.com/@RadiantCapita…

WazirX - $230m in July
x.com/WazirXIndia/st…
liminalcustody.com/blog/update-on…

DMM Bitcoin - $305m in May
The least amt is known about DMM, including whether keys were cold vs hot. Early theories said address poisoning. It def wasn't that. Attached is rampant speculation (likely all wrong)
See also: x.com/mononautical/s…Image
Image
Image
Also, note, any organization that can implement / enforce EDR, etc. should do so. Full stop. End of conversation.

However, the crypto industry generally considers this a non-starter for all sorts of philosophical + practical reasons.

So, until we get there, here's the deal:
Read 15 tweets
Sep 5
Alright so comments here are a bit looney and I don’t particularly like them bc it distracts and undermines the actual risk.

Spoiler: @coinbase getting hacked is not the risk.

But there is still risk. Even when using Coinbase.
This gunna be long. Sorry. But it needs to be said. Clearly.

First: the reason I say Coinbase is not the risk is because they take INSANE measures to mitigate the risk of being hacked.

They always have.

They are really fucking serious abt security across the board.
Coinbase is NOT different bc they’ve *eliminated* the risk though.

Bc they haven’t. Bc they can’t. NO ONE CAN.

This shit is wild. The incentives are too much. The hackers have too many resources.

They will literally burn 0 days to get at Coinbase. They *have* burned 0 days.
Read 18 tweets
Jul 8
Crypto folks (hopefully) already know that Lazarus is one of the most prevalent threat actors targeting this industry.

They rekt more people, companies, protocols than anyone else.

But it's good to know exactly how they get in. Bc another smart contract audit won't save you.
For example, one long-time fave method:
- Contact employee via social/messaging app
- Direct them to a Github for a job offer, "skills test," or to help with a bug
- Rekt individual's device
- Gain entry to company's AWS
- Rekt company (and their users)

cloud.google.com/blog/topics/th…
Image
With permission, I’m sharing a recent convo that led to $2m+ stolen so you can see how this DPRK crew (TraderTraitor) is operating today.

These convos are pretty rare to see. Thefts occur months later, so very few uncover how the initial entry was made.

cisa.gov/news-events/cy…Image
Read 14 tweets
Jun 19
Txn History Deposit 1

0x5a7732d8710af819dd16c82d38ed4385e137285c

0xce7d8feb6f4a88f4a2694beb8f92be6a1670d3a8fa243ab3416b46f4576d3fc5

0x8cd115e1d45dc80894204244a2749cb7cdb7ac7b14cf9809cac19714d3626bfc

0xa119fd1efd639fde5837566dfd843ba401825702e7694ce1591194b2b98297ae

0x0dea174d7bd9f6e978b98e6e1d0a0f1fc22d90f82f35537b1754d3f73652f1d6

0xa2bd92a528ffc2cb66f7317ff9e6ad55f094112e2937980c8b782d052d22dc76

0x886f187b7f3929032072a98160dac084d02a0ce62b556c64140d76f399d4922d

0x9d661a1d89613e2fa53a9ca63ad64db5401cde7d70f4eefb883724b0f1a57a31

0x1dbc11b50913f8633c049072428f4db0cce4d38cabe6087afc472c6668f5dc1a

0xa3a4a5878da0240cf0dbcb1b68bde88b877ed2c0c2390d000f796cda2c579af9

0xa158192d24ca8fa79c95fa52f8c3d564e8f6304bacea9c9dfca440d7da33ddf7

0xa7285a96eb95dd76ce129f063424679a6d465b7b9a284cdac528405c75ce8393

0x3dd977a7b2edbbe629a8bab9a9b3f0ccf253ea12e31c6f748ddac9e025167e67
Read 20 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!

Follow Us!

:(