PoolTogether - YY'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: 90/111

Findings: 1

Award: $19.29

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

19.2867 USDC - $19.29

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
edited-by-warden
duplicate-431

External Links

Lines of code

https://github.com/GenerationSoftware/pt-v5-prize-pool/blob/4bc8a12b857856828c018510b5500d722b79ca3a/src/PrizePool.sol#L299-L306

Vulnerability details

Impact

The setDrawManager function in the contract can be invoked by any Ethereum address. This exposes the contract to potential risks if malicious actors exploit this unrestricted access.

A malicious actor could potentially take control of the contract by setting the drawManager address to an address under their control before the legitimate owner gets a chance to set it.

function setDrawManager(address _drawManager) external { if (drawManager != address(0)) { revert DrawManagerAlreadySet(); } drawManager = _drawManager; emit DrawManagerSet(_drawManager); }

Proof of Concept

function setDrawManager set as external and there is only one restriction to prevent drawManager is not equal to 0, which means drawManager can be any address.

Alice sees that the smart contract has been deployed but the drawManager hasn't been set yet. She try to set the drawManager to an address under her control. The contract now follows Alice's commands instead of the intended drawManager address.

Tools Used

Manual Analysis

Implement a permission scheme (e.g., an onlyOwner modifier) to limit who can call the setDrawManager function. Only the owner of the contract or an authorized address should have the right to execute this function.

Assessed type

Access Control

#0 - c4-judge

2023-07-14T22:59:33Z

Picodes marked the issue as duplicate of #356

#1 - c4-judge

2023-08-06T10:31:36Z

Picodes changed the severity to 2 (Med Risk)

#2 - c4-judge

2023-08-06T10:32:29Z

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