Skip to content
Business logic Audit finding Intermediate

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.

leastwood Follow

Originally disclosed on Code4rena

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 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.

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.

0xScotch (sponsor) confirmed

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 maltPurchased is used to calculate rewards, an exploiter can effectively use an auction to purchase as many arbitrage tokens as they desire.

Using any amount greater 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

The original report as published on Code4rena, by leastwood. 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 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

  1. An auction is currently active.
  2. A user sends collateral tokens to the LiquidityExtension contract.
  3. The same user calls purchaseArbitrageTokens with amount 0.
  4. 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.

More by leastwood

View all

70 more disclosed reports, best first.

More from Malt Protocol - Versus 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.