Synthetix Logic Error Bug Fix Review
Synthetix used the wrong variable when calculating the amount to rebate after a price drop, so a user could call exchange before reclaiming their rebate and receive an inflated amount. An attacker could exploit this to obtain more tokens than they should.
immunefi.com
Published on immunefi.com
On May 2, 2022, whitehat thunderdeep14 submitted a critical bug in Synthetix via Immunefi, which the Synthetix team then shortly patched.
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 the code passed the original source amount instead of the amount after settlement when calculating the destination amount, leading to an inflated rebate.
Impact
An attacker could receive more tokens than they were owed, potentially draining funds from the system.
What the attacker needed
Ability to call exchange before reclaiming rebate
The fix
The vulnerability was fixed by correcting the variable used in the calculation.
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.
When you swap tokens on Synthetix, if the price changes during the swap, you get a rebate. The code used the original amount instead of the adjusted amount to calculate the rebate, so you could get too much. This meant someone could exploit it to get extra tokens.
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.