ClearingHouse fail if broken amm whitelisted #67
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
duplicate
This issue or pull request already exists
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Lines of code
https://github.com/code-423n4/2022-02-hubble/blob/ed1d885d5dbc2eae24e43c3ecbf291a0f5a52765/contracts/ClearingHouse.sol#L339
Vulnerability details
Impact
Governance can whitelist amm in ClearingHouse using the
whitelistAmm
function. Since a lot of function in the ClearingHouse contract will iterate each of the amm inamms
and call various amm.function(), if a broken amm is whitelisted or became broken, many of those functions will revert. There are no mechanism to remove amm from theamms
array so the protocol will fail.Proof of Concept
https://github.com/code-423n4/2022-02-hubble/blob/ed1d885d5dbc2eae24e43c3ecbf291a0f5a52765/contracts/ClearingHouse.sol#L339
Recommended Mitigation Steps
The text was updated successfully, but these errors were encountered: