PoolTogether micro contest #1 - cmichel's results

A protocol for no loss prize savings on Ethereum

General Information

Platform: Code4rena

Start Date: 29/07/2021

Pot Size: $20,000 USDC

Total HM: 8

Participants: 12

Period: 3 days

Judge: LSDan

Total Solo HM: 2

Id: 24

League: ETH

PoolTogether

Findings Distribution

Researcher Performance

Rank: 4/12

Findings: 6

Award: $2,002.31

🌟 Selected for report: 3

πŸš€ Solo Findings: 0

Findings Information

🌟 Selected for report: cmichel

Also found by: hickuphh3, jonah1005, pauliax

Labels

bug
3 (High Risk)
SwappableYieldSource

Awards

565.8571 USDC - $565.86

External Links

Handle

cmichel

Vulnerability details

The SwappableYieldSource.redeemToken function transfers tokens from the contract back to the sender, however, it uses the ERC20.transferFrom(address(this), msg.sender, redeemableBalance) function for this. Some deposit token implementations might fail as transferFrom checks if the contract approved itself for the redeemableBalance instead of skipping the allowance check in case the sender is the from address.

This can make the transaction revert and the deposited funds will be unrecoverable for the user.

It's recommended to use _depositToken.safeTransfer(msg.sender, redeemableBalance) instead.

#0 - PierrickGT

2021-08-06T16:18:15Z

#1 - 0xean

2021-08-24T16:37:03Z

re-opening this issue and marking #25 as a duplicate of this issue which clearly articulates the potential severity of unrecoverable user funds.

#2 - PierrickGT

2021-08-30T15:37:14Z

Findings Information

🌟 Selected for report: 0xRajeev

Also found by: cmichel, pauliax, shw

Labels

bug
duplicate
1 (Low Risk)
mStableYieldSource
SwappableYieldSource

Awards

169.7571 USDC - $169.76

External Links

Handle

cmichel

Vulnerability details

Description: safeApprove is now deprecated, see this comment.

As per OpenZepplin documentation β€œwhenever possible, use safeIncreaseAllowance and safeDecreaseAllowance instead”.

#0 - PierrickGT

2021-08-06T16:41:11Z

Findings Information

🌟 Selected for report: shw

Also found by: cmichel

Labels

bug
duplicate
2 (Med Risk)
mStableYieldSource
SwappableYieldSource

Awards

419.1534 USDC - $419.15

External Links

Handle

cmichel

Vulnerability details

There are ERC20 tokens that may make certain customizations to their ERC20 contracts. One type of these tokens is deflationary tokens that charge a certain fee for every transfer() or transferFrom(). Others are rebasing tokens that increase in value over time like Aave's aTokens (balanceOf changes over time).

Impact

The MStableYieldSource/SwappableYieldSource.supplyTokenTo() function will fail when the underlying token is a fee-on transfer token.

One possible mitigation is to measure the asset change right before and after the asset-transferring routines

#0 - PierrickGT

2021-08-11T23:23:41Z

Findings Information

🌟 Selected for report: tensors

Also found by: GalloDaSballo, cmichel, hickuphh3

Labels

bug
duplicate
2 (Med Risk)
SwappableYieldSource

Awards

169.7571 USDC - $169.76

External Links

Handle

cmichel

Vulnerability details

The SwappableYieldSource._setYieldSource function approves the new yield source but does not reset the old yield source's approval to zero.

It could be the case that the old yield source is compromised or has a bug and could therefore transfer and steal any deposit token in the contract.

It's recommended to reset the approval for the old yield source to zero.

#0 - PierrickGT

2021-08-06T16:10:31Z

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