top | item 35954422

Case study: fake hardware cryptowallet

206 points| freerk | 2 years ago |kaspersky.com

156 comments

order

TacticalCoder|2 years ago

Another nasty supply chain attack exists, way simpler (unlikely to work on knowledgeable users though)... A legit hardware wallet is shipped, but with fake documentation accompanying it. Some evil people working for delivery companies would swap legit hardware wallet for the exact same model, but with documentation using the official company's logo and font and saying, basically:

"Here's your hardware wallet, initialize it with the seed written on this piece of paper, it's the only one that's going to work for this hardware wallet. Do not lose this seed or you'll lose access to your funds!".

Several unsuspecting users, not aware that a random seed is supposed to be generated by the hardware wallet (or by throwing dice, or whatever) have been pwned this way.

Gigachad|2 years ago

There have also been cases of software using malicious seed generators which have semi predictable outputs. People assume it’s safe because they see what looks like random seeds, combined with no network activity. But the attacker can then just scan over the whole possible key space and check for funds.

irjustin|2 years ago

There's a shelf life to this attack for each distributer though. You'll eventually distribute to users who _do_ understand what's happening and they'll raise alarms.

With the article, it can go unsuspecting for years even simply waiting for maximum distribution and then a coordinated attack.

paulpauper|2 years ago

The surface of attack is so big, no one should use hardware wallets for anything more than beer money

themagician|2 years ago

Incredible. This is so sophisticated and takes so much effort it makes you wonder just how many other wallets are compromised from before you even use them. There are so many other low effort attacks you can run that the fact that people are doing THIS really makes me wonder just how many wallets out there are 100% compromised.

It would be trivial for any iOS-based software wallet to compromise your seed before your private key before is even created. You don't even need fancy spyware that calls home. If the seed is generated from a method that isn't random you'd never know. It will appear random to you, but the author of the software could simply increment on a known value and be able to recreate every private key ever created with that app. No one would ever know. The attacker could sit silent for years or even decades, and if they DID drain a wallet there would be no way to prove it and no one would believe the victim. It would just be a case of, "Well, you must have leaked your seed, it's your fault."

I can even see something like Coinbase Wallet being 100% compromised. The apology post is probably already written in a draft somewhere.

1ark|2 years ago

There was a recent drainage of many wallets, even old untouched ones on Ethereum. I don't think it was resolved. Your scenario is likely imo, and the fictional quote was what I saw.

paulpauper|2 years ago

pre-generate seed, sell wallet purporting seed is random when it's not, steal crypto

how many people can or will verify the key is truly one-of-a-kind?

dboreham|2 years ago

Title seems misleading (and isn't the article title). It implies that Trezor is a fake wallet. The article is actually about a wallet that purports to be made by Trezor but is in fact not (hardware supply chain attack).

renonce|2 years ago

It does uncover a vulnerability about Trezor that allows attackers to fake a Trezor without the user knowing it. It should have been defended via attestation, and software downloaded from the official website should have checked the attestation signature so they know the firmware hasn’t been tampered with.

acaloiar|2 years ago

Agreed -- the title should say (Trezor Impostor) to make it clear that Trezor is not the fake.

somat|2 years ago

"choose models with special versions of protected microcontrollers"

I don't see how this is helpful advice.

The whole point of the article was how the look and feel of a legitimate hardware wallet was cloned.

Under these circumstances there is no way to tell what is in the device(clear housing perhaps?). all it has to do is act like the real device. It does not matter how good your security chip actually is if all I have to do is copy the correct interface.

Unrelated: the use of that particular version is a strangely shoddy mistake. It should have been very easy to use a version string that exists. In which case that version would never have been skipped??? perhaps at one point that was a real version and trezor pulled it due to it's use in a batch of clone units.

magnat|2 years ago

> the use of that particular version is a strangely shoddy mistake. It should have been very easy to use a version string that exists

Perhaps attackers wanted to discourage user from trying to upgrade firmware/bootloader before first use by using version one step higher than officially released. If they used older version number, savvy user might try to flash newest firmware and discover something isn't quite right. Using nonexistent, but plausible looking version number, can also be used to explain minor discrepancies in behavior between fake and original unit, if some are introduced by mistake.

lxgr|2 years ago

> It does not matter how good your security chip actually is if all I have to do is copy the correct interface.

A security chip actually deserving the name (i.e. a tamper-proof one) can protect a private key even against physical attacks, with the corresponding public key marked as authentic by the manufacturer.

If the interface contains a challenge-response interaction with that private key (and ideally ties that to any further communication with the trusted applications on it), you can't copy/emulate that.

lisper|2 years ago

I foresaw this years ago, which prompted me to build this:

https://sc4.us/hsm/

It's an HSM which you can flash yourself. Unfortunately, it never generated much interest and so I had to fold up the tent. But maybe it was just ahead of its time.

saganus|2 years ago

I remember when this came out, and was interested in getting one!

Unfortunately I was aiming to use it to generate TOTP codes (and replace my authenticator app), but IIRC it needed a RT clock and thus a battery, which was not part of the design.

Great project though.

technion|2 years ago

I was a huge fan of what was promised here. I ordered one but every time I tried to work with it I had some catastrophic unrelated incident - like a curse lol.

Anyway I suspect the problem is the nature of crypto. For this to actually take off, you would have needed to hand a bag of money to Jake Paul or John mcafee or a bitboy, and I'd highly suspect a really good product has a hard time competing against those that do

lxgr|2 years ago

Neat! But is the microcontroller used tamper-proof? If not, your customers are still vulnerable to supply chain attacks such as the one in the article.

munificent|2 years ago

> The bootloader checks the digital signature of the firmware and, if an anomaly is detected, displays an unoriginal firmware message and deletes all the data in the wallet.

This seems like a horrendous design, like a safe that burns the money inside if you try to tamper with it. Sure, it might protect a malicious thief from absconding with the funds, but it is also an attack vector for any bad actor that simply wishes to cause you harm.

phire|2 years ago

The user is meant to keep a backup copy of the seed written down somewhere safe.

If the firmware had been tampered with, there is no safe way to extract the key. Better that the user uses the recovery seed on a fresh device.

Which means the weakest link of your fancy hardware wallet is how well you hide that bit of paper with your seed phrase.

derefr|2 years ago

If the attacker's goal was to erase the user's data, and the firmware _didn't_ erase data on invalidation, then the attacker could simply write a firmware that erases the user's data.

StingyJelly|2 years ago

Thus the importance of backing up the seed phrase. Bad actor that wishes to cause harm can use a hammer.

lxgr|2 years ago

If an attacker succeeds in tampering with the firmware on a crypto wallet (and more generally any secure authentication/transaction confirmation device), losing authentication/signature capabilities is very likely the second worst outcome.

quickthrower2|2 years ago

Same design as the HDD on your laptop. The solution is a backup.

ibz|2 years ago

Unlike a safe, a hardware wallet doesn't store money, it stores private keys. These keys are derived from a seed phrase you are supposed to back up offline.

Scoundreller|2 years ago

> The housing was difficult to open: its two halves were held together with liberal quantities of glue and double-sided adhesive tape instead of the ultrasonic bonding used on factory-made Trezors.

Other than having x-ray vision, one easy (but by no means perfect) verification to thwart these types of attacks is to weigh your devices.

Manufacturing should be consistent enough that resealing a device like this would be adding some grams that shouldn’t be there. And unlike something like a cisco router, nothing to cut out to make up for the added weight.

alden5|2 years ago

the problem is the sorta person to buy a wallet from a classifieds website isn't willing to spend $30 on a scale to weigh it, because if they had that money they'd just buy it from the official store instead

gnatman|2 years ago

I’m far from an expert and don’t own any cryptocurrency but I can’t imagine buying a hardware wallet from a “popular classifieds website”, i.e. ebay.

netsharc|2 years ago

Yeah, it's basically a good market for scammers: you're almost guaranteed whoever looking to buy this is is looking to store some large amount of money, so as a scammer your chances of big success is very large.

tetromino_|2 years ago

It is possible that the buyer of this wallet had no better option. For example, the official place to buy these devices might refuse to ship them to his country.

roland35|2 years ago

This just is another example to me how absurd it is to use crypto as a practical currency. There is no recourse for compromising your private key, and no way to know for sure that only you have a private key.

dools|2 years ago

> The main safeguard is to buy your wallet directly from the official vendor and choose models with special versions of protected microcontrollers (even original Trezors aren’t ideal in this sense: there are other brands’ wallets with better protected chips and extra protection mechanisms).

Yet another hilarious example of where a the solution to security in an alledgedly trustless system designed to subvert authority comes down to ... trust and authority.

lxgr|2 years ago

You have to trust somebody when it comes to hardware devices.

If you don't do anything, that includes the OEM, their supply chain, your delivery courier, an evil maid etc.

If you have the choice of reducing that list to only the OEM, isn't that a win? That's what attestation does.

lxgr|2 years ago

For physically hardened devices, this attack vector can be mitigated quite efficiently by including an attestation key with each device and validating that after taking possession (or ideally before any interaction). At least one competitor does that.

To my knowledge, current Trezor devices are unfortunately not (sufficiently) key extraction proof, though; in that scenario, attackers might be able to extract the private attestation key of a legitimate device and then go on to impersonate it in their own version.

This again could be mitigated by e.g. making the attestation key device-unique and offering an online validation service (which could keep track of unusual verification patterns and alert users), but it's not an easy problem to solve.

quickthrower2|2 years ago

How secure is the attestation key against the wallet CEO's kids being held hostage?

monero-xmr|2 years ago

If you want a hardware wallet, I recommend software in an air-gapped machine. Unless you can buy the hardware directly from the manufacturer, and ideally you walked into the factory and bought it at the source, the risk of compromise is too great.

derefr|2 years ago

> Unless you can buy the hardware directly from the manufacturer, and ideally you walked into the factory and bought it at the source, the risk of compromise is too great.

That's an awful idea. If you're the type of person to worry about being supply-chain-attacked, then targeted supply-chain attacks are far more likely to happen to you than untargeted ones are. Specifically, you are more likely to be supply-chain attacked by an entity who has the power to either compel or blackmail the OEM into giving you a first-party-adulterated device (think: Huawei network switches), than by an entity who's supply-chain-attacking random strangers. This doesn't just include governments, mind you, but also any sufficiently-wide-reaching criminal gang.

Showing up in person to the factory — or to a retail store — means the intelligence operative planted there can recognize you, and give you the "special" device prepared just for you; or the employee can be compelled by certain training (required to be allowed to sell such devices in certain countries) to follow the special instructions that come up when they swipe your credit card.

So what to do? Don't show up in person. Send a one-time proxy buyer to show up in person. And have the proxy buyer pay in cash, or using their own card.

Think what an American diplomat stationed in China would do if they absolutely needed to get e.g. a new smartphone right away. Normally they'd just wait for something like that to be sent over from America via diplomatic courier, specifically to avoid this problem. But if they couldn't — then proxy-buying at retail is the next-best solution.

(Funny enough, this is also the same thing that computer-hardware reviewers have to do to avoid getting a "reviewer special" binning of the hardware. Counterintelligence is oddly generalizable!)

flangola7|2 years ago

How do you feel about Yubikeys and HSM systems that corporations heavily rely on?

lxgr|2 years ago

Theoretically a nice idea, but where do you get your trusted software and hardware from?

The trusted codebase and set of OEMs seems an order of magnitude larger, and I'm not sure whether the lower likelihood of being specifically targeted as e.g. a crypto user by a supplier can make up for that.

hn_throwaway_99|2 years ago

I don't understand this. If you ever want to do anything with the funds in that wallet (e.g. sign transactions using the private key), you're going to need to connect it to a machine that can connect to the Internet. Otherwise, how is this any better than a cold storage paper wallet?

mrb|2 years ago

I would be immune to this attack because I always generate my own seeds, on a trusted computer. So I set up hardware wallets to import my seed, instead of trusting their seed generation algo. Of course this procedure doesn't protect against other hardware attacks, for example the wallet exfiltrating the private key somehow (R/F signal), but it certainly raises the bar for hackers.

mattdesl|2 years ago

Although you do open yourself to vulnerabilities in how you generate your random entropy—for average user, it might be worse than relying on a hardware wallet.

The safest play here for an average user is to just not buy your hardware wallets off eBay, as it seemed to be the case in the OP!

drdrey|2 years ago

you still trust that the hardware will use the seed you provided and not one of the pre-generated ones

tromp|2 years ago

What software do you use to generate your 256-bit seed, and to convert that into the 24 words that the hardware keys require as input?

drexlspivey|2 years ago

What would have prevented this attack is the following:

Use a little bit of python (there are libraries for this or you can do it yourself) to make sure that the addresses generated in the HW wallet by the 12 word mnemonic are indeed the correct addresses. For example the first segwit address using your private key and the derivation path 49h/0h/0h/0/0 should be deterministic. This way you know your 12 words are the ones used and the wallet is using known standards and not some homebrew crypto.

In fact you should always do that anyway in case the HW stops working and/or the company goes under. This way you can be sure that you can recreate your private keys from your mnemonic and access your funds no matter what.

friend_and_foe|2 years ago

That would not have stopped this attack. I think youre misunderstanding the attack, the seed is pregenerated.

The only thing that would have stopped this attack would be to generate your seed off the device. And then, since the device is counterfeit and there may very well be a way to exfiltrate seeds from it, to use a genuine device, but that's a different attack.

What youre saying though is a good idea, provided the device youre running this on (and therefore entering your seed into) is secure. Since this cannot really be guaranteed it is often advised to never enter your seed into a computer, for good reason.

dyeje|2 years ago

It seems kinda foolish to buy a second hand crypto wallet.

kosherhurricane|2 years ago

My #1 argument against the feasibility of cryptocurrency: Can my parents not their get money stolen?

PretzelPirate|2 years ago

Can crypto currency be used easily? Yes, through centralized entities like where your parents currently store their money.

Some people may forgoe ease and aim for self-custody because they value decentralization over convenience. Others will choose a middle ground where they and a centralized entity both hold part of the key, ensuring that the 3rd party can't move their funds without permission.

RalfWausE|2 years ago

This is an argument against any form of direct payment... i mean, you can get your cash stolen very easily...

KryDos|2 years ago

Does it mean that at the moment of releasing 2.0.4 the Trezor team already knew there is a fake firmware circling around?

I wonder if Trezor team communicated that in some maybe different way than that line in the CHANGELOG. Not blaming them of course, just wondering.

londons_explore|2 years ago

If I were Trezor and became aware of a fake firmware, I would:

* Offer rewards to anyone able to send me the fake devices or clues who is making them.

* Tell my clients to upgrade the firmware on devices before use. Make sure every new firmware is distinctive in some way - for example the boot screen, and tell the users to check for that to ensure they are actually running the firmware they thought they just flashed.

paulpauper|2 years ago

Easy to steal and cash out, сryptocurrency is one of the most attractive digital assets for attackers.

Has the author tried cashing out crypto? KYC anyone? It's harder than ever to cash out ,especially large sums. So many restrictions due to fraud.

Hardware wallets are never safe. the only safe way is to generate your own entropy, key derivation. Why would you ever trust a 3rd party to generate your keys?

hgsgm|2 years ago

With crypto, you get to cut out the middle man and be your own bank.

You have fraud team and IT security team on your staff, right?

magnat|2 years ago

What if each genuine unit would have entire PCB covered in glitter nail polish at factory? Based on a serial number of your device, you could check if a pattern on your device matches the one taken by manufacturer right after assembling the device.

stevage|2 years ago

Would someone be able to spell out how this attack works after initialisation? I don't really understand hardware wallets. How does the information about the user and their key make its way back to the people who created the device?

valleyer|2 years ago

The attackers know the key to begin with, before the user even gets their hands on the device. The compromised device pretends to generate a random key but instead generate one of twenty keys provided by the attackers.

lxgr|2 years ago

Other than generating a small set of known seeds, some signature formats (including ECDSA, which is used for many cryptocurrencies) also allow exfiltrating data through some of the values they consist of and which are required to validate them.

If the wallet uses deterministic ECDSA, or the algorithm used is deterministic by definition (such as EdDSA), this can be detected, but doing so requires validating some generated signatures on a second, trusted device.

lisbon44|2 years ago

> Intentionally skipped this version due to fake devices

uh oh! does this imply something is up that the trezor developers know of?

lalopalota|2 years ago

Yes, this implies that trezor developers know of fake devices claiming to run that version so they skipped that version number to ensure that no one who sees that version number would confuse it with an actual version.

garyfirestorm|2 years ago

Would the firmware update fail? if the user had decided to update it? Wouldn't that raise a suspicion?

WrtCdEvrydy|2 years ago

Probably. It seems it was designed to run with the crypto after one month. Trezor's security on the physical realm is pretty good, but this is just a good attack.

lxgr|2 years ago

How can a successful firmware update possibly be validated if you can't trust the device in the first place?

An attacker can just implement whatever "install firmware version xyz" command by returning "ok, did it!" and remembering that version number if it ever needs to be displayed.

A more complex attacker could emulate the entire firmware in more powerful hardware of the same physical profile and selectively intercept any input and output.

MagicMoonlight|2 years ago

And how is this better than just using regular money?

BobTheDestroyer|2 years ago

Trezor has additional checks that aren't covered here. I'd really like to know how those were defeated. Especially:

> All Trezor devices are distributed without firmware installed - you will need to install it during setup. This setup process will check if firmware is already installed on the device. If firmware is detected then the device should not be used.

>The bootloader verifies the firmware signature each time you connect your Trezor to a computer. Trezor Suite will only accept the device if the installed firmware is correctly signed by SatoshiLabs. If unofficial firmware has been installed, your device will flash a warning sign on its screen upon being connected to a computer.

https://trezor.io/learn/a/authenticate-model-one

There seems to be an element of user carelessness and naivety here. Anyone who follows Trevor's hardware verification checks surely needn't worry about these attacks.

lxgr|2 years ago

> All Trezor devices are distributed without firmware installed - you will need to install it during setup. This setup process will check if firmware is already installed on the device. If firmware is detected then the device should not be used. [...] The bootloader verifies the firmware signature each time you connect your Trezor to a computer. Trezor Suite will only accept the device if the installed firmware is correctly signed by SatoshiLabs.

This is an absurd security model. Where's the root of trust here? How do I know I am initially talking to an authentic "blank" device, and not a malicious one pretending to be one?

> If unofficial firmware has been installed, your device will flash a warning sign on its screen upon being connected to a computer.

Hopefully, malicious firmware won't meddle with this feature in any way...

The vendor here is either completely clueless, or is trying to paint a better picture for prospective customers despite knowing better.

crote|2 years ago

Both of these checks seem to rely on the device playing along nicely. During the setup process it can just pretend to be empty, and completely ignore the uploaded firmware. Similarly, the warning sign depends on the device to show it - which the article mentioned was patched out by the attacker.

LordShredda|2 years ago

How does the setup process check for firmware, anyways? If there's a malicious firmware preinstalled I'm guessing it could just lie to the host computer and pretend to be not there until setup is complete. Once an attacker has hardware control, no software can save you.

whimsicalism|2 years ago

They replaced the whole microcontroller. Doubt that these checks could resolve this if they were sophisticated enough.

web3-is-a-scam|2 years ago

Ah yes, flashing my own firmware. The future of finance.

RadixDLT|2 years ago

does Kaspersky still work for the Russian government?

LarsDu88|2 years ago

Nice article, but are we sure we want to elevate the status of FSB founded and funded Kapersky labs on the front page of HN?

PKop|2 years ago

If they're good at what they do, and provide value sharing their knowledge, yes.