-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Withdrawal from vMaia
vault only on first Tuesday of the month is not strictly enforced
#396
Comments
trust1995 changed the severity to QA (Quality Assurance) |
trust1995 marked the issue as grade-c |
This previously downgraded issue has been upgraded by trust1995 |
1 similar comment
This previously downgraded issue has been upgraded by trust1995 |
trust1995 marked the issue as primary issue |
trust1995 marked the issue as satisfactory |
Ignore grade-c, finding is valid Med. |
trust1995 marked issue #469 as primary and marked this issue as a duplicate of 469 |
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/maia/vMaia.sol#L109-L110
Vulnerability details
Impact
The withdrawal of
Maia
ERC-20 tokens from thevMaia
ERC-4626 vault should only be possible on the first Tuesday of the month.In fact, the withdrawal is possible on the first Tuesday of attempted withdrawal of the month, due to the insufficient check in L109/110 of vMaia.beforeWithdraw(...) which only requires the current day to be a Tuesday.
Example: In case no Maia DAO member withdraws his
Maia
tokens on the first Tuesday of the month, withdrawal on the second Tuesday of the month and so forth is still possible.It is stated at multiple instances throughout the ecosystem that the withdrawal is only possible on the first Tuesday of the month:
vMaia.sol
README.md
Therefore a base assumption for DAO members about the Maia ecosystem is broken. Potential withdrawals outside the specified time frame might cause problems for the front-end as well as lead to an unfair advantage for users who know about this loophole in contrast to those who don't.
Proof of Concept
The following test case demonstrates that a withdrawal is also possible on the second Tuesday of the month in case there was no withdrawal on the first. Just add this test case to
test/maia/vMaiaTest.t.sol:vMaiaTest
and run it withforge test -vv --match-test testWithdrawMaiaOnSecondTuesday
:Tools Used
VS Code, Foundry
Recommended Mitigation Steps
The issue can be resolved by strictly enforcing the first Tuesday of the month:
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: