Amun contest - pmerkleplant's results

We build tokens to make it easy to invest in crypto.

General Information

Platform: Code4rena

Start Date: 13/12/2021

Pot Size: $75,000 USDC

Total HM: 11

Participants: 30

Period: 7 days

Judge: leastwood

Total Solo HM: 4

Id: 68

League: ETH

Amun

Findings Distribution

Researcher Performance

Rank: 16/30

Findings: 3

Award: $840.09

🌟 Selected for report: 4

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: pmerkleplant

Also found by: WatchPug, certora, hyh, p4st13r4, pauliax, robee

Labels

bug
2 (Med Risk)
sponsor confirmed

Awards

228.0947 USDC - $228.09

External Links

Handle

pmerkleplant

Vulnerability details

Impact

There's a griefing attack vulnerability in the function joinTokenSingle in SingleTokenJoin.sol as well as SingleTokenJoinV2.sol which makes any user transaction fail with "FAILED_OUTPUT_AMOUNT".

Proof of Concept

The JoinTokenStruct argument for joinTokenSingle includes a field outputAmount to indicate the amount of tokens the user should receive after joining a basket (see line 135 and 130).

However, this amount is compared to the contract's balance of the token and reverts if the amount is unequal.

If an attacker sends some amount of a basket's token to the contract, every call to this function will fail as long as the output token equals the attacker's token send.

Refactor the require statement to expect at least the outputAmount of tokens, i.e. require(outputAmount >= _joinTokenStruct.outputAmount).

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