Closed c4-bot-2 closed 8 months ago
gzeon-c4 marked the issue as primary issue
gzeon-c4 marked the issue as sufficient quality report
gzeon-c4 marked the issue as high quality report
yanisepfl (sponsor) disputed
yanisepfl marked the issue as disagree with severity
All our main functions (e.g. deposit / withdraw / redeem / claim) have an associated method that allows users to directly interact with our protocol using/receiving IBTs. Hence the claim that "User Tokens will be stuck forever" is false.
Secondly, in the mentioned situation, the mitigation proposed would not be working if for instance the pre-request is to wait a certain period of time (e.g. wait 24 hours to withdraw).
We therefore dispute this issue and disagree with its severity. We consider it as a QA report. As a low issue, we acknowledge it but we will not be mitigating it since no user funds are at risk and there is not much we can do for such particular 4626 vaults.
JustDravee marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L278-L287
Vulnerability details
Impact
User deposit will be stuck forever in the PrincipalToken contract if the contract need Approval before withdrawal from the Vault the contract (standard EIP4626)
Proof of Concept
According to the EIP4626 standard it's possible that some Vault may implement a pre-requesting withdraw or redeem check in the Vault before a withdrawal may be performed and PrincipalToken.sol contract doesn't have any implementation that can first request the token from the Vault, before the withdrawal process resulting the tokens will be stuck forever in the PrincipalToken contract and users will going to loose all of their tokens for this.
EIP4626 snippet for Withdrawal:
EIP4626 snippet for Redeem:
Demo Vault Code:
PoC to Test revert:
Tools Used
Manual Analysis
Recommended Mitigation Steps
Implement a function which can be used to call approval function of the Tokenized Vault contract(ERC4626) for the Vaults which required a approval before withdraw/redeem.
Assessed type
DoS