Users Can Contribute To An Auction Without Directly Committing Collateral Tokens
The purchaseArbitrageTokens function allows users to bypass the auction commitment cap by directly sending collateral tokens to the LiquidityExtension contract and then calling the function with amount 0. This lets an attacker influence the average malt price used in the Auction contract and purchase unlimited arbitrage tokens.
Submitted by leastwood
purchaseArbitrageTokens enables users to commit collateral tokens and in return receive arbitrage tokens which are redeemable in the future for Malt tokens. Each auction specifies a commitment cap which when reached, prevents users from participating in the auction. However, realCommitment can be ignored by directly sending the LiquidityExtension contract collateral tokens and subsequently calling purchaseArbitrageTokens.
Proof of Concept
Consider the following scenario:
- An auction is currently active.
- A user sends collateral tokens to the
LiquidityExtensioncontract. - The same user calls
purchaseArbitrageTokenswith amount0. - The
purchaseAndBurncall returns a positivepurchasedamount which is subsequently used in auction calculations.
As a result, a user could effectively influence the average malt price used throughout the Auction contract.
https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/Auction.sol#L177-L214 https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/LiquidityExtension.sol#L117-L128
Recommended Mitigation Steps
Consider adding a check to ensure that realCommitment != 0 in purchaseArbitrageTokens.
Alex the Entreprenerd (judge) commented:
The warden has identified a way to side-step the cap on commitments. Because the commitments are used for calculating limits, but
maltPurchasedis used to calculate rewards, an exploiter can effectively use an auction to purchase as many arbitrage tokens as they desire.Using any
amountgreater than zero will eventually allow to end the auction, however, by using 0 this process can be repeated continuously.Agree with the finding and severity
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 purchaseArbitrageTokens function does not verify that the realCommitment amount is greater than zero, allowing a user to bypass the commitment cap by sending tokens directly to the contract and calling the function with zero amount.
Impact
A user could effectively influence the average malt price used throughout the Auction contract and purchase as many arbitrage tokens as they desire, bypassing the commitment cap.
What the attacker needed
An active auction; Ability to send tokens directly to contract
How it was found
- An auction is currently active.
- A user sends collateral tokens to the LiquidityExtension contract.
- The same user calls purchaseArbitrageTokens with amount 0.
- The purchaseAndBurn call returns a positive purchased amount which is subsequently used in auction calculations.
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.
In this auction system, users are supposed to commit collateral tokens through a function that tracks how much they've committed, and there's a cap on total commitments. The bug is that someone can send tokens directly to the contract (bypassing the tracking) and then call the purchase function with zero amount, which still counts the tokens for price calculations but not for the cap. This lets them get more arbitrage tokens than allowed and manipulate the auction's average price.
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.