PoolTogether - Co0nan's results

A protocol for no-loss prize savings

General Information

Platform: Code4rena

Start Date: 07/07/2023

Pot Size: $121,650 USDC

Total HM: 36

Participants: 111

Period: 7 days

Judge: Picodes

Total Solo HM: 13

Id: 258

League: ETH

PoolTogether

Findings Distribution

Researcher Performance

Rank: 55/111

Findings: 2

Award: $165.56

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

2.2492 USDC - $2.25

Labels

bug
3 (High Risk)
satisfactory
duplicate-396

External Links

Lines of code

https://github.com/GenerationSoftware/pt-v5-vault/blob/b1deb5d494c25f885c34c83f014c8a855c5e2749/src/Vault.sol#L394

Vulnerability details

Impact

Anyone can call mintYieldFee function to claim the Yield fees due to missing access control check.

Proof of Concept

During Vault initialize, the owner set the yieldFeeRecipient address, this address supposed to be the only entity who can mint the yield fee. Similar to the _liquidationPair and _claimer addresses.

Unlike the liquidate function which checks the sender and claimPrizes, the function mintYieldFee doesn't check if the msg.sender == yieldFeeRecipient allowing anyone to call it.

Tools Used

Manual

Add require check to confirm the sender is the yieldFeeRecipient

Assessed type

Access Control

#0 - c4-judge

2023-07-14T22:24:16Z

Picodes marked the issue as duplicate of #396

#1 - c4-judge

2023-08-05T22:03:29Z

Picodes marked the issue as satisfactory

Findings Information

🌟 Selected for report: 0xkasper

Also found by: 0xStalin, 0xbepresent, 3docSec, Aymen0909, Co0nan, GREY-HAWK-REACH, Jeiwan, minhtrng, qpzm

Labels

bug
3 (High Risk)
satisfactory
upgraded by judge
duplicate-351

Awards

163.3108 USDC - $163.31

External Links

Lines of code

https://github.com/GenerationSoftware/pt-v5-vault/blob/b1deb5d494c25f885c34c83f014c8a855c5e2749/src/Vault.sol#L988

Vulnerability details

Impact

An attacker can force delegate any user to the sponsorship address without his permission.

Proof of Concept

The function sponsor calls _sponsor internally passing the assets and the _receiver address. The _receiver address is the user who will receive the vault shares.

The issue here is that the _sponsor function invoke _twabController.sponsor(_receiver); passing the _receiver instead of the msg.sender, the function _twabController.sponsor will call _delegate function internally passing the receiver as the from address.

The function _delegate will update the delegates mapping of the from in the vault to the sponsorship address.

Attacker can pass the assets as Zero which result in zero share minted but he managed to delegate the victim to the sponsorship address.

Tools Used

Manual

Use msg.sender instead of receiver when calling _twabController.sponsor();

Assessed type

Context

#0 - c4-judge

2023-07-18T15:47:15Z

Picodes marked the issue as duplicate of #393

#1 - c4-judge

2023-08-06T10:30:11Z

Picodes changed the severity to 3 (High Risk)

#2 - c4-judge

2023-08-06T10:30:19Z

Picodes marked the issue as satisfactory

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