Tiny Things Matter – The Story of a Stellar Lumens Exploit
A rounding error in Stellar's decentralized exchange matching engine allowed an attacker to buy micro-amounts of any asset at a 1:1 rate instead of the market price. With automation, an attacker could profit up to 16,000 XLM per hour by repeatedly exploiting this flaw.
medium.com
Published on medium.com
Bankers are always quite watchful on all aspects concerning numbers rounding during money transfers. That’s the case when tiny things matter, especially when the financial institution processes millions of transactions daily.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a rounding error in the matching engine that caused dust-sized offers to execute at a 1:1 rate rather than the market price.
Impact
An attacker could earn up to 16,000 XLM per hour, and the attack could be hard to stop on a decentralized network, potentially causing market panic and network congestion.
What the attacker needed
Funded Stellar accounts; automation script; cheap cloud server
The fix
The bug was fixed in Stellar Core v10, and validators upgraded the network to that version.
How it was found
- Create multiple accounts and fund them with XLM.
- Run a bot that submits many ManageOffer operations per account frequently.
- Periodically sell acquired assets at market price and transfer profits to a master account.
- Repeat while offers remain open, then switch to another asset.
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 write-up has not been written yet. The Original tab links to the source.
Stellar is a system for trading digital assets. A rounding mistake in its trading software meant that very small trades were processed at a fixed one-to-one rate instead of the real market price. An attacker could make many tiny trades to buy valuable assets cheaply and sell them for a profit.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.