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

No gaps for upgradeability #258

Closed
code423n4 opened this issue Oct 8, 2022 · 2 comments
Closed

No gaps for upgradeability #258

code423n4 opened this issue Oct 8, 2022 · 2 comments
Labels
bug Something isn't working 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

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-10-blur/blob/main/contracts/BlurExchange.sol#L30

Vulnerability details

Impact

BlurExchange is an upgradeable contract. The contract doesn't include storage gaps. If this contract is inherited, this will cause storage collisions if new variables are added in it in a later upgrade. This is recommended here: https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#storage-gaps.

Proof of Concept

https://github.com/code-423n4/2022-10-blur/blob/main/contracts/BlurExchange.sol#30

Tools Used

Manual inspection

Recommended Mitigation Steps

Add uint256[50] __gap after all the state variables.

@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 Oct 8, 2022
code423n4 added a commit that referenced this issue Oct 8, 2022
@GalloDaSballo
Copy link
Collaborator

Dup of #410

@GalloDaSballo GalloDaSballo added the duplicate This issue or pull request already exists label Oct 13, 2022
@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 Oct 27, 2022
@GalloDaSballo
Copy link
Collaborator

L

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 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
Projects
None yet
Development

No branches or pull requests

2 participants