Incorrect implementation of the EIP-5095 standard for maxRedeem() and maxWithdraw() #212
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%)
🤖_33_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/383202d0b84985122fe1ba53cfbbb68f18ba3986/src/tokens/PrincipalToken.sol#L482-L485
https://github.com/code-423n4/2024-02-spectra/blob/383202d0b84985122fe1ba53cfbbb68f18ba3986/src/tokens/PrincipalToken.sol#L458-L462
Vulnerability details
Impact
The EIP-5095 standard states that the function MUST factor in both global and user-specific limits, like if redemption is entirely disabled (even temporarily) it MUST return 0.
When the protocol is paused and redemption is temporarily disabled, this function should return 0.
Yet, both functions returns the value as if redemption is still enabled, which is a clear-cut violation of the EIP-5095 standard.
Proof of Concept
From: EIP-5095
PrincipalToken.sol
PrincipalToken.sol
PrincipalToken.sol
PrincipalToken.sol
Tools Used
Manual Review
Recommended Mitigation Steps
Change the functions so that it will return 0 when the protocol is paused.
Assessed type
Other
The text was updated successfully, but these errors were encountered: