Maple Finance contest - shw's results

Maple Finance delivers capital-efficient borrowing for top tier institutions

General Information

Platform: Code4rena

Start Date: 08/04/2021

Pot Size: $100,000 USDC

Total HM: 3

Participants: 10

Period: 14 days

Judge: Nick Johnson

Total Solo HM: 3

Id: 4

League: ETH

Maple Finance

Findings Distribution

Researcher Performance

Rank: 2/10

Findings: 2

Award: $22,270.74

🌟 Selected for report: 2

🚀 Solo Findings: 1

Findings Information

🌟 Selected for report: shw

Labels

bug
2 (Med Risk)
sponsor confirmed
resolved

Awards

11135.3712 USDC - $11,135.37

External Links

Handle

shw

Vulnerability details

** Editing on a previous submission to clarify more details **

Impact

In Pool.sol, the lockup restriction of withdrawal (Pool.sol#396) can be bypassed or reduced if new liquidity providers cooperate with existing ones.

Proof of Concept

  1. A liquidity provider, Alice, deposits liquidity assets into the pool and minted some FDTs. She then waits for lockupPeriod days and calls intendToWithdraw to pass her withdrawal window. Now she is available to receive FDTs from others.
  2. A new liquidity provider, Bob, deposits liquidity assets into the pool and minted some FDTs. Currently, he is not allowed to withdraw his funds by protocol design.
  3. Bob and Alice agree to cooperate with each other to reduce Bob's waiting time for withdrawal. Bob transfers his FDT to Alice via the _transfer function.
  4. Alice calls intendToWithdraw and waits for the withdrawCooldown period. Notice that Alice's depositDate is updated after the transfer; however, since it is calculated using a weighted timestamp, the increased amount of lockup time should be less than lockupPeriod. In situations where the deposit from Alice is much larger than that from Bob, Alice could only even need to wait for the withdrawCooldown period before she could withdraw any funds.
  5. Alice then withdraws the amount of FDT that Bob transferred to her and transfers the funds (liquidity assets) to Bob. Bob successfully reduces (or bypasses) the lockup period of withdrawal.

Tools Used

None

Force users to wait for the lockup period when transferring FDT to others. Or let the depositDate variable record the timestamp of the last operation instead of a weighted timestamp.

#0 - lucas-manuel

2021-04-27T19:47:14Z

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