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

dobrevaleri - Upgrades might cause storage collision #296

Open
sherlock-admin3 opened this issue Nov 4, 2024 · 0 comments
Open

dobrevaleri - Upgrades might cause storage collision #296

sherlock-admin3 opened this issue Nov 4, 2024 · 0 comments

Comments

@sherlock-admin3
Copy link
Contributor

sherlock-admin3 commented Nov 4, 2024

dobrevaleri

Medium

Upgrades might cause storage collision

Summary

When creating upgradable contracts that inherit from other contracts is important that there are storage gap in case storage variable are added to inherited contracts. If an inherited contract is a stateless contract (i.e. it doesn't have any storage) then it is acceptable to omit a storage gap, since these function similar to libraries and aren't intended to add any storage.
The contracts EthosAttestation, EthosDiscussion, EthosProfile, EthosReview and EthosVote inherit from the AccessControl and SignatureControl, which are abstract stateful contract. The lack of _gap in these contract could lead to storage collisions if another state variables are introduced.

Root Cause

Missing storage gap in AccessControl and SignatureControl contracts

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

AccessControl and SignatureControl can pose a significant risk when updating a contract because they can shift the storage slots of all inherited contracts.

PoC

No response

Mitigation

Add storage gaps to all inherited contracts that contain storage variables.

@sherlock-admin4 sherlock-admin4 changed the title Expert Ruby Yeti - Upgrades might cause storage collision dobrevaleri - Upgrades might cause storage collision Nov 20, 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