PoolTogether V5: Part Deux - seerether's results

A protocol for no-loss prize savings.

General Information

Platform: Code4rena

Start Date: 02/08/2023

Pot Size: $42,000 USDC

Total HM: 13

Participants: 45

Period: 5 days

Judge: hickuphh3

Total Solo HM: 5

Id: 271

League: ETH

PoolTogether

Findings Distribution

Researcher Performance

Rank: 30/45

Findings: 1

Award: $89.63

🌟 Selected for report: 0

šŸš€ Solo Findings: 0

Findings Information

Awards

89.6296 USDC - $89.63

Labels

bug
3 (High Risk)
low quality report
satisfactory
duplicate-82

External Links

Lines of code

https://github.com/GenerationSoftware/pt-v5-draw-auction/blob/f1c6d14a1772d6609de1870f8713fb79977d51c1/src/RngRelayAuction.sol#L133 https://github.com/GenerationSoftware/pt-v5-draw-auction/blob/f1c6d14a1772d6609de1870f8713fb79977d51c1/src/RngRelayAuction.sol#L137 https://github.com/GenerationSoftware/pt-v5-draw-auction/blob/f1c6d14a1772d6609de1870f8713fb79977d51c1/src/RngRelayAuction.sol#L139 https://github.com/GenerationSoftware/pt-v5-draw-auction/blob/f1c6d14a1772d6609de1870f8713fb79977d51c1/src/RngRelayAuction.sol#L142

Vulnerability details

Impact

This will result in a larger reward fraction, allowing the caller to unfairly claim more of the rewards.

Proof of Concept

The _rngCompletedAt timestamp is controlled by the caller. They can make _auctionElapsedSeconds smaller by providing a higher _rngCompletedAt to increase their reward fraction. For example, if the real RNG completion time was 1 hour ago, they could pass a _rngCompletedAt of 30 mins ago. This makes the _auctionElapsedSeconds smaller, so the reward fraction will be higher

Tools Used

Manual

Use block.timestamp instead of relying on the passed _rngCompletedAt

Assessed type

Other

#0 - c4-pre-sort

2023-08-08T04:12:29Z

raymondfam marked the issue as duplicate of #82

#1 - c4-pre-sort

2023-08-08T04:14:16Z

raymondfam marked the issue as low quality report

#2 - raymondfam

2023-08-08T05:40:01Z

The report is minimally elaborated.

#3 - HickupHH3

2023-08-14T02:50:46Z

Keyword i'm looking for is access control, this issue does not touch on it.

However, it did point out that the caller can "unfairly claim more of the rewards" by passing in a malicious param

#4 - c4-judge

2023-08-14T02:50:50Z

HickupHH3 marked the issue as satisfactory

Findings Information

Awards

89.6296 USDC - $89.63

Labels

bug
3 (High Risk)
low quality report
satisfactory
duplicate-82

External Links

Lines of code

https://github.com/GenerationSoftware/pt-v5-draw-auction/blob/f1c6d14a1772d6609de1870f8713fb79977d51c1/src/RngRelayAuction.sol#L147-L148

Vulnerability details

Impact

When the rewards are calculated using _computeRewards(), the attacker's inflated rewardFraction will be used, giving them a bigger share

Proof of Concept

The _rngAuctionResult passed to rngComplete() is stored directly into the auctionResults array without any validation. An attacker could call rngComplete() with a manipulated _rngAuctionResult that has an inflated rewardFraction value. This would allow the attacker to receive a larger share of the rewards.

Tools Used

Manual

,_rngAuctionResult should be validated before using it. For example: • Check that rewardFraction is within an expected range • Ensure recipient is the address of the valid RNG relay contract • Compare values to previously stored auction results to detect manipulation

Assessed type

Other

#0 - c4-pre-sort

2023-08-08T04:13:19Z

raymondfam marked the issue as duplicate of #82

#1 - c4-pre-sort

2023-08-08T04:13:29Z

raymondfam marked the issue as low quality report

#2 - c4-judge

2023-08-14T02:51:21Z

HickupHH3 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