Skip to content
Business logic Audit finding Intermediate

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.

0x52 Follow

Originally disclosed on Code4rena

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 medium severity issue.


The original report as published on Code4rena, by 0x52. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by 0x52

View all

211 more disclosed reports, best first.

More from Alchemix contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.