Skip to content
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

momo - abitrary/large data can be passed into function getSupplyCollateralCalldata #49

Open
sherlock-admin3 opened this issue Oct 21, 2024 · 0 comments

Comments

@sherlock-admin3
Copy link
Contributor

sherlock-admin3 commented Oct 21, 2024

momo

High

abitrary/large data can be passed into function getSupplyCollateralCalldata

Summary

The type and size of data required for function getSupplyCollateralCalldata was not specified. As it is an external function, malicious actors can try pass, malicious data such an attack contract byte data to break or re-enter the code.
Large, meaningless data can also be passed by malicous actors, overloading the system, incuring gas cost and
causing griefing attacks or DOS

https://github.com/sherlock-audit/2024-10-morpho-x-index/blob/main/index-protocol/contracts/protocol/integration/lib/Morpho.sol#L40

Attack Path

  1. attacker writes a malicious contract with the plan to take over ISetToken contract .
  2. attacker passes the bytecode of the contract to function getSupplyCollateralCalldata which calls back into function invokeSupplyCollateral which at the end of this function IsetToken is invoked
    https://github.com/sherlock-audit/2024-10-morpho-x-index/blob/main/index-protocol/contracts/protocol/integration/lib/Morpho.sol#L74

Impact

No response

PoC

No response

Mitigation

  1. specify the type/ size if data, if possible
  2. Use a re-entrant modifier from tested contracts like openzeppelin contracts
@sherlock-admin2 sherlock-admin2 changed the title Sparkly Fleece Mammoth - abitrary/large data can be passed into function getSupplyCollateralCalldata momo - abitrary/large data can be passed into function getSupplyCollateralCalldata Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant