code-423n4 / 2022-01-trader-joe-findings

2 stars 0 forks source link

Improper Upper Bound Definition on the Fee #255

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

Jujic

Vulnerability details

Impact

The rJoePerSec does not have any upper or lower bounds. Values that are too large will lead to reversions in several critical functions.

Proof of Concept

https://github.com/code-423n4/2022-01-trader-joe/blob/a1579f6453bc4bf9fb0db9c627beaa41135438ed/contracts/RocketJoeStaking.sol#L151

function updateEmissionRate(uint256 _rJoePerSec) external onlyOwner {
        updatePool();
        rJoePerSec = _rJoePerSec;
        emit UpdateEmissionRate(msg.sender, _rJoePerSec);
    }

Tools Used

Remix

Recommended Mitigation Steps

Consider define upper and lower bounds on the _rJoePerSec.

cryptofish7 commented 2 years ago

Confirming issue but disagree with severity.

Fix: https://github.com/traderjoe-xyz/rocket-joe/pull/112