Malt Finance contest - tabish's results

Yield farmable, incentive-centric algorithmic stable coin.

General Information

Platform: Code4rena

Start Date: 25/11/2021

Pot Size: $80,000 USDC

Total HM: 35

Participants: 32

Period: 7 days

Judge: GalloDaSballo

Total Solo HM: 27

Id: 59

League: ETH

Malt Finance

Findings Distribution

Researcher Performance

Rank: 29/32

Findings: 3

Award: $66.55

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
2 (Med Risk)

Awards

20.04 USDC - $20.04

External Links

Handle

tabish

Vulnerability details

The contract are missing slippage checks which can lead to being vulnerable to sandwich attacks here in this case it is more risky as principal funds are at risk.

A common attack in DeFi is the sandwich attack. Upon observing a trade of asset X for asset Y, an attacker frontruns the victim trade by also buying asset Y, lets the victim execute the trade, and then backruns (executes after) the victim by trading back the amount gained in the first trade. Intuitively, one uses the knowledge that someone’s going to buy an asset, and that this trade will increase its price, to make a profit. The attacker’s plan is to buy this asset cheap, let the victim buy at an increased price, and then sell the received amount again at a higher price afterwards.

See UniswapHandler.buyMalt:

router.swapExactTokensForTokens( rewardBalance, 0, // amountOutMin path, address(this), now );

Impact

Detailed description of the impact of this finding.

Trades can happen at a bad price and lead to receiving fewer tokens than at a fair market price. The attacker’s profit is the protocol’s loss.

Add minimum return amount checks.

Accept a function parameter that can be chosen by the transaction sender, then check that the actually received amount is above this parameter.

Alternatively, check if it’s feasible to send these transactions directly to a miner such that they are not visible in the public mempool. Maybe use flashbots rpc

#0 - 0xScotch

2021-12-10T00:21:29Z

#219

#1 - GalloDaSballo

2022-01-26T13:29:10Z

Duplicate of #219

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter