TransmuterBuffer.sol calls depositUnderlying with no slippage bounds
The TransmuterBuffer contract calls depositUnderlying with a minimum output of zero, so any amount of slippage is accepted. If the buffer is invoked at an unfavourable time, a large portion of the deposited funds could be lost to slippage.
Submitted by 0x52
Loss of funds in TransmuterBuffer
Proof of Concept
If the buffer is called during and unfavorable time then a large portion of deposited funds may be lost due to slippage because deposit is called with 0 as the minimum out allowing any level of slippage
Recommended Mitigation Steps
Implement a slippage calculation similar to \_alchemistWithdraw to protect against it
0xfoobar (Alchemix) acknowledged, disagreed with severity and commented:
This function is only called by keeper bots harvesting yields, which should not be subject to large slippage and could be sent through a private mempool if necessary. However, we acknowledge that a configurable parameter could enable greater protection, even if in practice the issue does not occur.
0xleastwood (judge) decreased severity to Medium and commented:
Because this requires the keeper role to sandwich attack the protocol when yield is harvested, this better fits the criteria of a
mediumseverity issue.
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 the deposit call lacks a slippage parameter, passing zero as the minimum output instead of calculating a bound like the withdraw function does.
Impact
A large portion of deposited funds could be lost to slippage if the buffer is called at an unfavourable time, though the maintainers note the function is only called by keeper bots and the issue does not occur in practice.
What the attacker needed
Keeper role calls the function; unfavourable market conditions
The fix
A slippage calculation similar to the withdraw function should be implemented to protect against this.
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 can set a minimum amount it will accept back. Here that minimum was set to zero, so the swap would go through no matter how bad the exchange rate was. If someone else manipulated the price at that moment, the contract could receive far less than expected.
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.