-
Notifications
You must be signed in to change notification settings - Fork 2
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
ERC1155: Admin can withdraw unclaimed token #42
Comments
kirk-baird marked the issue as primary issue |
waynehoover marked the issue as disagree with severity |
We don’t want the excess 1155 tokens, they should be locked in the Quest Contract so no users can ever get them |
kirk-baird changed the severity to QA (Quality Assurance) |
This previously downgraded issue has been upgraded by kirk-baird |
kirk-baird marked the issue as satisfactory |
kirk-baird marked issue #528 as primary and marked this issue as a duplicate of 528 |
kirk-baird changed the severity to 2 (Med Risk) |
Lines of code
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Erc1155Quest.sol#L54
Vulnerability details
Impact
The ERC20 Quest ensures that unclaimed funds will be locked from Admin withdrawal even after endTime. This ensures User to claim there funds by redeeming ticket at any moment
The same check is missing in case of ERC1155 Quest. Admin will be able to withdraw token which user missed to claim within endTime which is wrong
Proof of Concept
Lets say X-10 users have claimed there ticket and got required funds using the
claim
functionNow endTime has reached
Admin calls the
withdrawRemainingTokens
function to withdraw the excess tokensIdeally 10 users are still remaining from claiming their tickets, so Owner should be allowed to only withdraw balance-10 amount
But seems like this check is missing and Admin can withdraw full balance
Recommended Mitigation Steps
Calculate the total number of participant of the ERC1155 quest by the endTime, lets say this number is X
Owner should now only be allowed to retrieve totalParticipants-X tokens
The text was updated successfully, but these errors were encountered: