Skip to content
Business logic Disclosed report Intermediate

Hardware Wallets Do Not Check Unlock TIme

The Monero hardware wallet implementations (Trezor and Ledger) do not verify the unlock time field when signing transactions. An attacker with malware on the user's computer could trick the user into signing a transaction with a very high unlock time, permanently locking the funds.

thecharlatan Follow

Originally disclosed on HackerOne

Medium 6.6 View original
  • Triaged in 43 days
  • Fixed in 7 months
  • Disclosed after 18 months

Summary:

The hardware wallet implementations using the monero wallet do not check the unlock time when signing. This allows malware on the user's computer (which the hardware wallet should protect from) to permanently lock-up all the user's funds if the user signs a transaction on the device with a very high unlock time.To provide a scenario for this kind of attack: A disgruntled employee can use this vector to permanently cripple a business' funds.

Releases Affected:

All releases since inclusion of hardware wallet support.

Steps To Reproduce:

Reproduction is easy, just create a new wallet with monero-wallet-cli with either Trezor or Ledger as a keystore. Then sign a transaction with locked_transfer and set a high unlock time.

Supporting Material/References:

I disclosed this vulnerability on 02.02.2020 to both Trezor and Ledger. Trezor was able to quickly patch the vulnerability, since they already parsed the unlock time field. They will release this patch beginning of April. No patch for the monero wallet is required in their case. Ledger has not patched the vulnerability yet. Unlike Trezor, they do not parse the unlock time field in the firmware currently, so their patch might require a change in the monero wallet. The possibility of requiring this patch is the reason why I am raising this report now, such that monero developers can prepare for its inclusion in a point release. I will stick to the 90 day disclosure timeline measured from 02.02.2020 . The Ledger developers have vouched to patch the problem by end of this period.

Impact

Permanently lock-up a user's hardware wallet funds.

The original report as published on HackerOne, by thecharlatan. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Monero hardware wallet support lets a user keep the wallet keys on a device such as a Trezor or a Ledger while the desktop wallet software, monero-wallet-cli, drives the signing. The point of the hardware wallet is that malware on the user's computer cannot move funds, because every transaction has to be confirmed and signed on the device itself.

Monero transactions can carry an unlock time, which prevents the outputs from being spent until a given block height or timestamp. The wallet exposes this through locked_transfer. The report is about the interaction between that field and the hardware wallet signing flow: the device is supposed to show the user what they are authorising, and the unlock time is part of that.

Setup

The report gives no version numbers, firmware versions or host details. The stated precondition is simply a wallet created with monero-wallet-cli using either Trezor or Ledger as the keystore, on any release since hardware wallet support was included. The researcher states that all such releases are affected.

Finding it

The researcher noticed that the hardware wallet implementations using the Monero wallet do not check the unlock time when signing. The device therefore signs a transaction whose outputs are locked far into the future without checking the unlock time.

That matters because the threat model of a hardware wallet is a compromised host. Malware on the user's computer is exactly what the device is meant to defend against, and here the host can influence a field that has permanent consequences for the funds, while the user still completes what looks like a normal signing operation on the device.

Exploitation

Step 1: Create a hardware-backed wallet

Create a new wallet with monero-wallet-cli, choosing either Trezor or Ledger as the keystore. The report does not give the exact command line for this step.

Step 2: Sign a locked transfer with a high unlock time

Sign a transaction with locked_transfer and set a high unlock time:

Text
locked_transfer

The report does not include the full invocation with its arguments, only the command name and the instruction to set a high unlock time. The transaction is signed on the device. Because the unlock time is not checked during signing, the resulting transaction locks the outputs until that height or time is reached.

Step 3: The funds are locked

The outputs cannot be spent until the unlock time passes. With a sufficiently high unlock time, the funds are locked permanently in practice.

Root cause

The signing path does not validate the unlock time. The report distinguishes the two vendors here: Trezor already parsed the unlock time field, which is why they could patch quickly, while Ledger did not parse the unlock time field in the firmware at the time of the report, so their fix might require a change in the Monero wallet as well. The gap is that the unlock time is not checked when signing.

Impact

An attacker with malware on the user's computer can permanently lock up the user's hardware wallet funds, provided the user signs a transaction on the device with a very high unlock time. The researcher's scenario is a disgruntled employee using this vector to permanently cripple a business's funds. The impact as stated is the permanent lock-up of the funds; the report does not describe theft or key extraction.

Fix

The report describes the state of remediation rather than a code change. Trezor patched the vulnerability quickly because they already parsed the unlock time field, with the patch to be released at the beginning of April, and no patch to the Monero wallet is required in their case. Ledger had not patched it at the time of writing; because their firmware did not parse the unlock time field, their patch might require a change in the Monero wallet, which is why the report was raised so that Monero developers could prepare to include it in a point release. The Ledger developers said they would patch the problem by the end of the 90 day disclosure period measured from 02.02.2020.

Variants to test

  • Other hardware wallet integrations for coins with time-locked or height-locked outputs: sign a transfer with an extreme lock value and check whether the device displays or rejects it. A positive result is a device that signs without showing the lock.
  • Other transaction fields the host supplies and the device is expected to confirm, such as fees and change addresses: a positive result is a field that changes the outcome for the user but is neither parsed nor displayed.
  • Firmware that parses a field but does not enforce limits on it: a positive result is a parsed value accepted at an extreme without a warning.

Hunting notes

This kind of bug hides at the boundary between host software and a signing device, where the host builds the transaction and the device is trusted to check it. During recon, the signal is a signing flow that parses only part of the transaction, or a vendor note that a field is not yet parsed in firmware. The researcher showed impact by framing it in the hardware wallet's own threat model, malware on the host, and by giving a concrete scenario, a disgruntled employee crippling a business's funds, rather than a theoretical lock-up.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

A hardware wallet is a small physical device, such as a Trezor or a Ledger, that holds the secret keys to a cryptocurrency wallet. The idea is simple: even if your computer is infected with malware, the attacker cannot move your coins, because every payment has to be approved and signed on the device itself. The device is meant to be the one place where you see what you are actually authorising.

Monero is a cryptocurrency, and its wallet software can create transactions with an "unlock time". An unlock time is a rule that says the money being sent cannot be spent again until a certain point in the future, either a block height (a position in the blockchain, the public ledger of transactions) or a timestamp. The wallet command that does this is called locked_transfer.

The researcher found that the hardware wallet implementations for Monero did not check the unlock time when signing. So malware on the user's computer could build a transaction with an extremely high unlock time, the user would sign it on the device, and the funds would then be locked away effectively forever. The report's example scenario is a disgruntled employee using this to permanently cripple a business's funds.

CVSS is a standard scoring system for how serious a security flaw is, where a higher number means more risk.

Context

Monero hardware wallet support lets a user keep the wallet keys on a device such as a Trezor or a Ledger, while the desktop wallet software, monero-wallet-cli, drives the signing. monero-wallet-cli is a command-line program: you type commands into a text window instead of clicking buttons.

The point of the hardware wallet is that malware on the user's computer cannot move funds, because every transaction has to be confirmed and signed on the device itself. "Signing" here means producing a cryptographic proof that the owner approved the transaction; the secret key never leaves the device.

Monero transactions can carry an unlock time, which prevents the outputs from being spent until a given block height or timestamp. "Outputs" are the chunks of money a transaction creates for the recipient; until they are spendable, they are frozen. The wallet exposes this through locked_transfer. The report is about the interaction between that field and the hardware wallet signing flow: the device is supposed to show the user what they are authorising, and the unlock time is part of that.

Setup

The report gives no version numbers, firmware versions or host details. The stated precondition is simply a wallet created with monero-wallet-cli using either Trezor or Ledger as the keystore, on any release since hardware wallet support was included. A "keystore" is the component that holds the keys; here it is the hardware device rather than a file on the computer. The researcher states that all such releases are affected.

Finding it

The researcher noticed that the hardware wallet implementations using the Monero wallet do not check the unlock time when signing. The device therefore signs a transaction whose outputs are locked far into the future without checking the unlock time.

That matters because the threat model of a hardware wallet is a compromised host. A "threat model" is a plain description of who might attack you and how; here the assumed attacker is malicious software running on your own computer. Malware on the user's computer is exactly what the device is meant to defend against, and here the host can influence a field that has permanent consequences for the funds, while the user still completes what looks like a normal signing operation on the device.

Exploitation

Step 1: Create a hardware-backed wallet

Create a new wallet with monero-wallet-cli, choosing either Trezor or Ledger as the keystore. The report does not give the exact command line for this step.

Step 2: Sign a locked transfer with a high unlock time

Sign a transaction with locked_transfer and set a high unlock time:

Text
locked_transfer

This block is just the name of the wallet command, not a full command with arguments. The report does not include the full invocation with its arguments, only the command name and the instruction to set a high unlock time. In plain terms: you run this command, tell it to send some money, and give it a very large lock value. The transaction is signed on the device. Because the unlock time is not checked during signing, the resulting transaction locks the outputs until that height or time is reached.

Step 3: The funds are locked

The outputs cannot be spent until the unlock time passes. "Mined" means the transaction has been written into the blockchain and is now permanent. With a sufficiently high unlock time, the funds are locked permanently in practice.

Root cause

The signing path does not validate the unlock time. "Root cause" means the underlying reason the bug exists, as opposed to its symptoms. The report distinguishes the two vendors here: Trezor already parsed the unlock time field, which is why they could patch quickly, while Ledger did not parse the unlock time field in the firmware at the time of the report, so their fix might require a change in the Monero wallet as well. "Parsing" a field means reading it and understanding what it says; "firmware" is the software built into the device. The gap is that the unlock time is not checked when signing. In other words, the maths protecting the transaction was fine; the device simply did not look at one important value.

Impact

An attacker with malware on the user's computer can permanently lock up the user's hardware wallet funds, provided the user signs a transaction on the device with a very high unlock time. The researcher's scenario is a disgruntled employee using this vector to permanently cripple a business's funds. A "vector" is simply the route an attack takes. The impact as stated is the permanent lock-up of the funds; the report does not describe theft or key extraction.

Fix

The report describes the state of remediation rather than a code change. "Remediation" means the work done to close the hole. Trezor patched the vulnerability quickly because they already parsed the unlock time field, with the patch to be released at the beginning of April, and no patch to the Monero wallet is required in their case. Ledger had not patched it at the time of writing; because their firmware did not parse the unlock time field, their patch might require a change in the Monero wallet, which is why the report was raised so that Monero developers could prepare to include it in a point release. A "point release" is a small update to existing software rather than a major new version. The Ledger developers said they would patch the problem by the end of the 90 day disclosure period measured from 02.02.2020. A "disclosure period" is the agreed window between telling the vendor and making the problem public.

Variants to test

These are related places to look for the same kind of mistake:

  • Other hardware wallet integrations for coins with time-locked or height-locked outputs: sign a transfer with an extreme lock value and check whether the device displays or rejects it. A positive result is a device that signs without showing the lock.
  • Other transaction fields the host supplies and the device is expected to confirm, such as fees and change addresses: a positive result is a field that changes the outcome for the user but is neither parsed nor displayed. "Change" is the leftover money a transaction sends back to your own wallet.
  • Firmware that parses a field but does not enforce limits on it: a positive result is a parsed value accepted at an extreme without a warning.

Hunting notes

This kind of bug hides at the boundary between host software and a signing device, where the host builds the transaction and the device is trusted to check it. "Recon" means the early looking-around phase before testing anything. During recon, the signal is a signing flow that parses only part of the transaction, or a vendor note that a field is not yet parsed in firmware. The researcher showed impact by framing it in the hardware wallet's own threat model, malware on the host, and by giving a concrete scenario, a disgruntled employee crippling a business's funds, rather than a theoretical lock-up.

Glossary

  • Hardware wallet: a physical device that stores cryptocurrency keys and signs transactions, so the keys never sit on a normal computer.
  • Malware: malicious software running on a computer without the owner's intent.
  • Monero: a cryptocurrency whose wallet software is the subject of this report.
  • monero-wallet-cli: the command-line Monero wallet program, driven by typed commands.
  • Trezor / Ledger: two brands of hardware wallet.
  • Keystore: the component that holds the wallet keys; here the hardware device.
  • Signing: producing a cryptographic proof that the owner approved a transaction, without exposing the secret key.
  • Transaction: a record that moves money from one wallet to another.
  • Output: a chunk of money created by a transaction for a recipient; it can be spent once it is unlocked.
  • Unlock time: a rule that stops outputs being spent until a given block height or timestamp.
  • locked_transfer: the Monero wallet command that sends money with an unlock time.
  • Block height: the position of a block in the blockchain, used as a way of measuring time.
  • Blockchain: the public, append-only ledger of transactions.
  • Mined: written into the blockchain and therefore permanent.
  • Threat model: a description of who might attack a system and how.
  • Host: the ordinary computer that talks to the hardware wallet.
  • Firmware: the software built into a hardware device.
  • Parse: to read a field and understand its value.
  • Root cause: the underlying reason a bug exists.
  • Vector: the route an attack takes.
  • Remediation: the work done to fix a vulnerability.
  • Patch: a software update that fixes a problem.
  • Point release: a small update to existing software.
  • Disclosure period: the agreed time between telling a vendor and making a problem public.
  • Change address: the address that receives leftover money back to your own wallet.
  • Recon: the early information-gathering phase before testing.
  • CVSS: a standard scoring system for the severity of a security flaw.
  • Severity: a label for how serious a flaw is, here medium.

More by thecharlatan

View all

1 more disclosed report, best first.

More from Monero

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.