FoundrySolidityLayer 2
7.25 ETH
Submission Details
Impact: high
Likelihood: high

Pool owner can pause the `stake` and earn more bonuses when others get less

Author Revealed upon completion

Root + Impact

The pool owner can pause the stake and earn more bonuses when others get less

  • A staker gets bonuses based on the time they staked

  • If they stake early, they get more bonuses; if they stake late, they get fewer bonuses

  • One staker's stake time affects the bonus calculation for all stakers

    • The bonus calculation uses userScore, globalScore

The docs/DESIGN.md does not have this assumption

Description

A pool owner can call ConfidencePool::pause and pause the pool's stake/bonus paths

function pause() external onlyOwner whenPoolNotPaused {
_pause();
}
function stake(uint256 amount) external nonReentrant whenPoolNotPaused { // <--@

Attack Path

  • The pool owner will stake a large amount early

    • so that he can get more bonuses

  • Now he will call ConfidencePool::pause

  • because now the stakeis paused, Stakers can not stake early to get more bonuses

  • Later, the pool owner unpause the pool

  • Now other stakers can stake to get bonuses

    • But now they get fewer bonuses as they stake later

    • And the owner gets more bonuses as he stakes early

  • One staker's stake time affects the bonus calculation for all stakers

    • The bonus calculation uses userScore, globalScore

There is another attack path (the previous attack path makes more impact)

  • where stakers before pause receive more bonuses

    • Here we are talking about the normal stakers, not the pool owner himself

  • and the stakers who can not stake because of the pause state, so they stake later get fewer bonuses

The pool owner's attack path shows much more impact, as his intention is different from others

Recommended Mitigation

remove the pauseable functionality

or

onlyModerator should pause and unpause

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!