Closed c4-bot-4 closed 8 months ago
gzeon-c4 marked the issue as duplicate of #33
gzeon-c4 marked the issue as sufficient quality report
JustDravee marked the issue as partial-75
JustDravee marked the issue as satisfactory
JustDravee marked the issue as partial-75
Lines of code
https://github.com/code-423n4/2024-02-spectra/blob/25603ac27c3488423a0739b66e784c01a3db7d75/src/tokens/PrincipalToken.sol#L461-L463
Vulnerability details
Vulnerability explanation
According to the almighty EIP-5095, the
maxWithdraw()
function "MUST return the maximum amount of underlying tokens that could be redeemed from holder through withdraw and not cause a revert". However instead of this the cheekymaxWithdraw()
function in the contract will revert when paused because of thewhenNotPaused
modifierImpact
The function reverts when the redemptions are paused, which is not in line with the requirements of the EIP-5095.
Proof of Concept
The
maxWithdraw()
reverts when the DAO decides to paused the contract. If the function is called while paused the function reverts.
Tools Used
EIP-5095 docs
Recommended Mitigation Steps
If the contract happens to be paused, return 0 instead of revertin'.
Assessed type
Other