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

[M3] Missing storage gaps in upgradeable contracts #682

Open
code423n4 opened this issue Sep 15, 2022 · 2 comments
Open

[M3] Missing storage gaps in upgradeable contracts #682

code423n4 opened this issue Sep 15, 2022 · 2 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-09-nouns-builder/blob/7e9fddbbacdd7d7812e912a369cfd862ee67dc03/src/governance/governor/storage/GovernorStorageV1.sol#L9

Vulnerability details

Impact

Upgradeable contracts do not follow the conventions so upgradeability is less flexible.

Proof of Concept

Storage gaps are a convention so removing them means that you will not be able to add new variables in future upgrades, at least no in your parent contracts. For your final contract it is better to add the gap in case you decide to inherit them in the future.

Gaps are missing in the following contracts.

  • Pausable
  • Ownable
  • ReentrancyGuard
  • EIP712
  • TokenStorageV1
  • TokenStorageTypes
  • ManagerStorageV1
  • GovernorStorageV1
  • TreasuryStorageV1
  • AuctionStorageV1

Recommended

​ Add this line at the end of every upgradeable contract

[+] uint256[50] private __gap;
@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Sep 15, 2022
code423n4 added a commit that referenced this issue Sep 15, 2022
@GalloDaSballo GalloDaSballo added the duplicate This issue or pull request already exists label Sep 20, 2022
@GalloDaSballo
Copy link
Collaborator

Dup of #358

@GalloDaSballo GalloDaSballo added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Sep 26, 2022
@GalloDaSballo
Copy link
Collaborator

L

@JeeberC4 JeeberC4 removed the duplicate This issue or pull request already exists label Oct 5, 2022
@JeeberC4 JeeberC4 reopened this Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

3 participants