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

Aggregated contractPCT's can be > 1 Ether #480

Closed
code423n4 opened this issue Jan 2, 2023 · 4 comments
Closed

Aggregated contractPCT's can be > 1 Ether #480

code423n4 opened this issue Jan 2, 2023 · 4 comments
Labels
bug Something isn't working downgraded by judge Judge downgraded the risk level of this issue duplicate-710 edited-by-warden 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

Comments

@code423n4
Copy link
Contributor

code423n4 commented Jan 2, 2023

Lines of code

https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/ProtocolDAO.sol#L107

Vulnerability details

Impact

The setClaimingContractPct function allows for aggregated percentages > 1 Ether which will result in a revert within startRewardsCycle

Proof of Concept

Currently, the setClaimingContractPct function nicely checks if the provided decimal for the provided contract is <= 1 Ether. However, it does not check if all three used contracts: ClaimMultisig, ClaimNodeOp and ClaimProtocolDAO have an aggregated value <= 1 Ether. If they are >1 Ether, the function startRewardsCycle will always revert in the following line: https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/RewardsPool.sol#L175.

Tools Used

VSCode

Recommended Mitigation Steps

Consider checking if all three contracts have an aggregated value <= 1 Ether, if not revert the function.

*This is the first contest i took part, therefore my submissions might not be ideal yet, if there are any questions feel free to contact me directly in discord :-)

@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 Jan 2, 2023
code423n4 added a commit that referenced this issue Jan 2, 2023
C4-Staff added a commit that referenced this issue Jan 6, 2023
@GalloDaSballo
Copy link

Screenshot 2023-01-07 at 10 40 15

Invalid

@c4-judge
Copy link
Contributor

c4-judge commented Jan 7, 2023

GalloDaSballo marked the issue as unsatisfactory:
Invalid

@c4-judge c4-judge closed this as completed Jan 7, 2023
@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label Jan 7, 2023
@c4-judge c4-judge added downgraded by judge Judge downgraded the risk level of this issue QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax duplicate-710 and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Jan 31, 2023
@c4-judge
Copy link
Contributor

Duplicate of #710

@GalloDaSballo
Copy link

My mistake, the finding is valid, but because of this check
https://github.com/code-423n4/2022-12-gogopool/blob/aec9928d8bdce8a5a4efe45f54c39d4fc7313731/contracts/contract/RewardsPool.sol#L175-L176

			revert IncorrectRewardsDistribution();

The finding is QA - Low Severity

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 downgraded by judge Judge downgraded the risk level of this issue duplicate-710 edited-by-warden 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
Projects
None yet
Development

No branches or pull requests

3 participants