-
Notifications
You must be signed in to change notification settings - Fork 0
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
MToken May be Inflation Attack #92
Comments
0xSorryNotSorry marked the issue as primary issue |
without a PoC, this is an invalid finding because yes, you could donate to the protocol and increase the share price, but you have to show a way to do this in a way that's profitable to an attacker. |
ElliotFriedman marked the issue as sponsor disputed |
@ElliotFriedman, I think that #264 does a good job in explaining how this would be profitable for an attacker:
I also like that #126 links to existing literature on this specific bug. #264 also goes to explain how you are protecting yourself against this vulnerability in mip00, but how the protection seems to be not enough given the cross-chain context.
|
alcueca marked the issue as selected for report |
This isn't a valid finding because known issues here explained in the readme: https://github.com/code-423n4/2023-07-moonwell/blob/fced18035107a345c31c9a9497d0da09105df4df/README.md#known-compound-v2-issues "New markets must be added with no collateral factor, and some small amount of the collateral token supply must be burned in order to avoid market manipulation. This is a known issue." |
So yes, it's a valid issue, but it is out of scope as we recognize this is an issue and don't want to award a payout for something that is clearly stated to be out of scope. |
Agree with the sponsor, except for #264. I'll continue the conversation there. |
alcueca marked the issue as unsatisfactory: |
Lines of code
https://github.com/code-423n4/2023-07-moonwell/blob/fced18035107a345c31c9a9497d0da09105df4df/src/core/MToken.sol#L340-L370
https://github.com/code-423n4/2023-07-moonwell/blob/fced18035107a345c31c9a9497d0da09105df4df/src/core/MErc20.sol#L171-L174
Vulnerability details
Impact
MToken
May beInflation Attack
likeERC4626 Inflation Attack
Proof of Concept
Currently
mToken
still has the commonERC4626 Inflation Attack
The number of assets can be increased by donating
MToken.sol#exchangeRateStoredInternal()
MErc20.sol#getCashPrior()
So it is still possible to mint first and then redeem, and finally 1 shares left, and then donate by direct transfer assert,Amplify
exchangeRate
, thus carrying outInflation Attack
Note: Although the initial mint
initialSupply
can be executed when creating a MToken, there is no restriction oninitialSupply==0
It is recommended to refer to the new 4.9.0 release of OpenZeppelin, which has a special version of
ERC4626 Inflation Attack
for thishttps://twitter.com/OpenZeppelin/status/1656066698410328064?s=20
Tools Used
Manual Review
Recommended Mitigation Steps
Reference: Implement or recommend mitigations for ERC4626 inflation attacks OpenZeppelin/openzeppelin-contracts#3706 (comment)
Assessed type
ERC4626
The text was updated successfully, but these errors were encountered: