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 limit on number of Reward token #106

Closed
code423n4 opened this issue Jun 1, 2022 · 2 comments
Closed

No limit on number of Reward token #106

code423n4 opened this issue Jun 1, 2022 · 2 comments
Labels
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 duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/VE3DRewardPool.sol#L102
https://github.com/code-423n4/2022-05-vetoken/blob/main/contracts/VE3DLocker.sol#L145

Vulnerability details

Impact

The current implementation of addReward seems to allow any number of reward token to be added. There should be a limit on the number of rewards allowed

Proof of Concept

  1. Operator calls addReward function with new _rewardsToken on VE3DLocker.sol#L145
  2. Operator perform Step 1 , 100 times
  3. 101 new Reward tokens are added to system showing no max limit

Recommended Mitigation Steps

Add below check in addReward function:

require(rewardTokens.length<MAX_ALLOWED, "Max reward crossed")
@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Jun 1, 2022
code423n4 added a commit that referenced this issue Jun 1, 2022
@solvetony solvetony added the duplicate This issue or pull request already exists label Jun 15, 2022
@solvetony
Copy link
Collaborator

Duplicate of #136

@solvetony solvetony marked this as a duplicate of #136 Jun 15, 2022
@GalloDaSballo
Copy link
Collaborator

Dup of #136

@GalloDaSballo GalloDaSballo added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value and removed 3 (High Risk) Assets can be stolen/lost/compromised directly labels Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants