sherlock-audit / 2024-05-pooltogether-judging

8 stars 4 forks source link

jo13 - PoolTogether on Blast L2: Rebasing WETH Allows Malicious Users to Inflate Contributions and Manipulate Prize Odds #111

Closed sherlock-admin3 closed 2 months ago

sherlock-admin3 commented 3 months ago

jo13

medium

PoolTogether on Blast L2: Rebasing WETH Allows Malicious Users to Inflate Contributions and Manipulate Prize Odds

Summary

The PoolTogether protocol deployed on BlastL2 uses WETH as the prize token. WETH on Blast L2 is a rebasing token that automatically generates yield over time. This setup introduces a critical vulnerability where a malicious user can exploit the generated yield to artificially inflate their contributions, thereby increasing their chances of winning prizes and decreasing the chances for honest users.

Vulnerability Detail

WETH on Blast L2 is a rebasing token WETH and USDB accounts have Automatic yield by default for both EOAs and smart contracts. Users can change their WETH and USDB accounts' yield mode by calling the configured function on the relevant token address.

// Define yield modes
enum YieldMode { AUTOMATIC, VOID, CLAIMABLE }

// Interface for interacting with yield-generating ERC-20 tokens
interface IERC20Rebasing {
 >> function configure(YieldMode) external returns (uint256);
  function claim(address recipient, uint256 amount) external returns (uint256);
  function getClaimableAmount(address account) external view returns (uint256);
}

Impact

Code Snippet

Manual Review

Recommendation

change the yield mode of WETH and USDB accounts by calling the configure function and making it a claimable relevant token address, and send it to the donator.

Duplicate of #114