#38003 [BC-Medium] A malicious coordinator calling `Emily::update_deposits` can make the entire Signers network inoperable
Submitted on Dec 21st 2024 at 12:44:37 UTC by @f4lc0n for Attackathon | Stacks
Report ID: #38003
Report Type: Blockchain/DLT
Report severity: Medium
Target: https://github.com/stacks-network/sbtc/tree/immunefi_attackaton_0.9/emily
Impacts:
API crash preventing correct processing of deposits
Description
Brief/Intro
The Signers network uses a multi-signature mechanism to execute sBTC deposits. For example, in a 3-5 multi-signature, as long as 3 coordinators are honest, the Signers network can operate normally.
However, in the current implementation, as long as a malicious coordinator calls the Emily::update_deposits
api to update the status of deposits from Pending to Confirmed, all Signers will no longer be able to process these deposits.
Vulnerability Details
The emily/handler/src/api/handlers/deposit.rs::update_deposits
code is as follows.
It does not check the identity of the caller. According to the sBTC architecture, all coordinators have the authority to call the API. Therefore, any coordinator can maliciously call the API to destroy the status of deposits in Emily.
A malicious coordinator can update all deposits to Confirmed, and then all other coordinators will not process them anymore.
Impact Details
This will cause the Signers network to no longer be able to process user deposits.
Fix
Emily should keep all the opinions of the coordinator on updating the deposits status and execute them when the opinions meet the threshold. Just like the Signer, it should follow the principle of multi-signature.
References
None
Proof of Concept
Patch
docker/sbtc/Dockerfile
, fix database bugPatch
signer/Cargo.toml
, add poc4 binAdd this code to
signer/src/bin/poc5.rs
Build docker
Wait for a while, run the demo
Wait for a while, run the PoC. This PoC simulates user behavior to create 10 deposits, and then simulates a malicious coordinator calling
Emily::update_deposits
to update the status of these deposits to ConfirmedYou will find that these deposits are not executed.
Was this helpful?