Sitemap

SlowMist: Detailed Analysis of Monero (XMR) Locked Transfer Attack (Released in 2019)

4 min readMay 8, 2023

--

Press enter or click to view image in full size

According to intelligence from SlowMist Zone, there have been reports of multiple exchanges experiencing Monero (XMR) transfer lock attacks. Upon receiving this news, the SlowMist security team immediately analyzed and followed up on the issue. We issued a warning in the SlowMist Zone and provided timely intelligence synchronization and assistance to our clients in detecting and fixing the issue, based on the principle of responsible disclosure. If there is a need for verification and detection services, please contact the SlowMist security team.

-Attack Steps-

0x01: Login to the wallet by entering the password through monero-wallet-cli.

0x02: Send a lock transaction through a command.

0x03: After the transfer is completed, the exchange fails to perform a locked_transfer check. The received coins are locked until a specified block height is reached before they can be unlocked (this can be understood as a time lock).

0x04: The malicious user immediately withdraws the funds and disappears, leaving the exchange confused.

-Resulting Impact-

First and foremost, this attack will not result in any financial loss for the exchanges. However, it will impede the liquidity of their XMR holdings.

Extreme case scenario: If the exchange only receives Monero coins that require a lock-up period of a year or more, leading to a situation where users may not be able to withdraw any coins within a year (and they would need to purchase additional coins to enable withdrawals).

-About the locked_transfer Command-

The monero-wallet-cli explains the locked_transfer command as follows:

locked_transfer [index=<N1>[,<N2>,…]] [<priority>] [<ring_size>] (<URI> | <addr> <amount>) <lockblocks> [<payment_id (obsolete)>]

Transfer order:

locked_transfer FromAddress ToAddress 0.0101 20000

FromAddress: Sending address (usually the attacker’s wallet address)

ToAddress: Receiving address (usually the exchange’s wallet address)

0.0101: Transfer amount

20000: Number of blocks to lock

-How to Protect Against It-

General exchanges usually use the get_transfers RPC interface to parse XMR transactions and detect whether deposits have been made. During parsing, it is only necessary to check the “unlock_time” field to determine whether it is greater than 0 for effective detection.

Note that if the “unlock_time” field in an XMR transaction is greater than 0, it indicates that the transaction has a locked block and should be refused confirmation as it is a malicious transaction. To avoid harm to the “user” interest caused by deposits not being credited, exchanges can use an alternative approach, which involves checking whether the locked block has been reached. If the locked block has not been reached, the deposit should not be credited.

-All Affected RPC Interfaces-

(1)get_transfer

(2)get_bulk_payments

(3)show_transfer

(4)get_payments

There is a need to check the “unlock_time” field for values greater than 0 in other places where the above four interfaces are used. If the value is greater than 0, deposits should not be credited.

This issue had previously been reported on HackerOne by a white hat hacker, and the official response from Monero was:

Press enter or click to view image in full size

Article link:

https://hackerone.com/reports/417515

Attached below is an excerpt from the official documentation.

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

Here’s a link to the official documentation:

https://www.getmonero.org/resources/developer-guides/wallet-rpc.html

About SlowMist

SlowMist is a blockchain security firm established in January 2018. The firm was started by a team with over ten years of network security experience to become a global force. Our goal is to make the blockchain ecosystem as secure as possible for everyone. We are now a renowned international blockchain security firm that has worked on various well-known projects such as Huobi, OKX, Binance, imToken, Crypto.com, Amber Group, Klaytn, EOS, 1inch, PancakeSwap, TUSD, Alpaca Finance, MultiChain, O3Swap, etc.

Website:
https://www.slowmist.com
Twitter:
https://twitter.com/SlowMist_Team
Github:
https://github.com/slowmist/

--

--

SlowMist
SlowMist

Written by SlowMist

SlowMist is a Blockchain security firm established in 2018, providing services such as security audits, security consultants, red teaming, and more.