maxWithdraw() will revert when paused but should return 0 instead #118
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-210
partial-75
Incomplete articulation of vulnerability; eligible for partial credit only (75%)
🤖_04_group
AI based duplicate group recommendation
sufficient quality report
This report is of sufficient quality
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
The text was updated successfully, but these errors were encountered: