Position owner should set allowed slippage
The top-up action uses a default swap slippage of 5% and allows up to 40%, which lets malicious keepers or owners sandwich the swap and profit at the user's expense.
Submitted by 0x52
TopUpAction.sol#L154 TopUpAction.sol#L187
The default swap slippage of 5% allows malicious keepers to sandwich attack topup. Additionally, up to 40% (_MINSWAPPERSLIPPAGE) slippage allows malicious owner to sandwich huge amounts from topup
Proof of Concept
Keeper can bundle swaps before and after topup to sandwich topup action, in fact it’s actually in their best interest to do so.
Recommended Mitigation Steps
Allow user to specify max swap slippage when creating topup similar to how it’s specified on uniswap or sushiswap to block attacks from both keepers and owners.
chase-manning (Backd) confirmed and resolved
According to C4 Judging criteria
Unless there is something uniquely novel created by combining vectors, most submissions regarding vulnerabilities that are inherent to a particular system or the Ethereum network as a whole should be considered QA. Examples of such vulnerabilities include front running, sandwich attacks, and MEV.
However since Backd use keeper to run topup transactions, which presumably are bots and smart contracts that can fetch onchain price directly. A large (5% default, up to 40%) seems excessive and can lead to user losing fund. Judging this as Medium Risk.
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
Impact
A malicious keeper or owner could sandwich the top-up swap and cause the user to lose funds, though the judge noted sandwich attacks are generally low severity unless the slippage is excessive.
What the attacker needed
User creates a top-up; attacker can front-run and back-run the swap
The fix
The issue was resolved by allowing the user to specify a maximum swap slippage when creating a top-up.
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.
When a contract swaps tokens, it accepts a price within a slippage limit. If that limit is too wide, someone who sees the swap coming can trade just before and after it to move the price and take the difference. Here the limit was 5% by default and could be as high as 40%, so the attacker could take a large cut.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.