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

Missing input validation to check that end > start #49

Open
code423n4 opened this issue Aug 14, 2021 · 2 comments
Open

Missing input validation to check that end > start #49

code423n4 opened this issue Aug 14, 2021 · 2 comments

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

setRewards() is missing input validation on parameters start and end to check if end > start. If accidentally set incorrectly, this will allow resetting new rewards while there is an ongoing one.

Proof of Concept

https://github.com/code-423n4/2021-08-yield/blob/4dc46470e616dd0cbd9db9b4742e36c4d809e02c/contracts/utils/token/ERC20Rewards.sol#L74-L88

Tools Used

Manual Analysis

Recommended Mitigation Steps

Add a require() to check that end > start.

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Aug 14, 2021
code423n4 added a commit that referenced this issue Aug 14, 2021
@alcueca
Copy link
Collaborator

alcueca commented Aug 15, 2021

If accidentally set incorrectly, this will allow resetting new rewards while there is an ongoing one.

I would say that if we set it incorrectly, we would like to reset it as soon as possible :)

Still, a good check to add, since otherwise it leads to strange behaviour.

@alcueca
Copy link
Collaborator

alcueca commented Aug 16, 2021

Fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants