Upgradeable Contracts doesn't use storage gap for some inherited contracts #213
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
invalid
This doesn't seem right
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2022-10-blur/blob/2fdaa6e13b544c8c11d1c022a575f16c3a72e3bf/contracts/BlurExchange.sol#L30
Vulnerability details
Impact
The
BlurExchange
contract is upgradeable but inherit fromReentrancyGuarded
andEIP712
which both does not have a storage gap. If in a future upgrade, additionnals state variables were to be added to one or both of these contracts it would shifts down all of the state variables below in the inheritance chain and potentially overwrite storage slots of theBlurExchange
contract.Proof of Concept
Link: https://github.com/code-423n4/2022-10-blur/blob/2fdaa6e13b544c8c11d1c022a575f16c3a72e3bf/contracts/BlurExchange.sol#L30
Openzeppelin notes about this: https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
Link to a similar issue: code-423n4/2022-05-rubicon-findings#67
Tools Used
Manual review.
Recommended Mitigation Steps
Add a storage gap to existing
ReentrancyGuarded
andEIP712
contracts.The text was updated successfully, but these errors were encountered: