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

The function getDeploymentBlock() in the Holographer contract returns an incorrect data type #107

Closed
Tracked by #88
code423n4 opened this issue Oct 22, 2022 · 4 comments
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 edited-by-warden QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax responded The Holograph team has reviewed and responded sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

code423n4 commented Oct 22, 2022

Lines of code

https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/Holographer.sol#L174

Vulnerability details

Impact

The function getDeploymentBlock() present in the Holographer contract returns an address, while everything indicates that the underlying value holds a uint256 that represents a block number, and even the function is named after that. This is caused because the contract uses unstructured storage and the slot value is sloaded directly into an address type, and could make integrations with this code fail, or even truncate the returned value since the address type is 20 bytes long.

The error is also present in the interface HolographerInterface.

Recommendation

The return type in the contract and interface should be changed to uint256.

@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 22, 2022
code423n4 added a commit that referenced this issue Oct 22, 2022
@gzeoneth gzeoneth added sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) and removed sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") labels Oct 31, 2022
@gzeoneth
Copy link
Member

The value is correct but the type is wrong, I think is low risk.

@alexanderattar
Copy link

Valid, but low risk. Type issue will be addressed

@ACC01ADE ACC01ADE added responded The Holograph team has reviewed and responded sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") labels Nov 9, 2022
@gzeoneth gzeoneth 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 Nov 19, 2022
@gzeoneth
Copy link
Member

As QA report

@gzeoneth
Copy link
Member

gzeoneth commented Nov 29, 2022

Consider with #113

@gzeoneth gzeoneth marked this as a duplicate of #113 Nov 29, 2022
@gzeoneth gzeoneth added the duplicate This issue or pull request already exists label Nov 29, 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 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 edited-by-warden QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax responded The Holograph team has reviewed and responded sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

4 participants