-
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
withdrawRemainingTokens could leave tokens in the contract #219
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
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-122
satisfactory
satisfies C4 submission criteria; eligible for awards
Comments
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 28, 2023
kirk-baird marked the issue as duplicate of #42 |
kirk-baird marked the issue as not a duplicate |
kirk-baird marked the issue as duplicate of #61 |
c4-judge
added
the
satisfactory
satisfies C4 submission criteria; eligible for awards
label
Feb 14, 2023
kirk-baird marked the issue as satisfactory |
kirk-baird changed the severity to 3 (High Risk) |
c4-judge
added
3 (High Risk)
Assets can be stolen/lost/compromised directly
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
downgraded by judge
Judge downgraded the risk level of this issue
and removed
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
3 (High Risk)
Assets can be stolen/lost/compromised directly
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
labels
Feb 20, 2023
kirk-baird changed the severity to 2 (Med Risk) |
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
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-122
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Erc20Quest.sol#L81-L87
Vulnerability details
Impact
The
withdrawRemainingTokens
function leaves tokens (for an amount equal toprotocolFee
) in the contract whenwithdraFee
is called earlier due to non tracking if withdraFee was already called.Proof of Concept
Assume balance = 150, unclaimedTokens = 0, protocolFee = 50. withdrawFee is called and balance becomes 100. When calling
withdrawRemainingTokens
nonClaimableTokens will be 100 - 50 = 50. 50 tokens are lost in the contract.Recommended Mitigation Steps
Keep track if
withdrawFee
is called and if yes don't subtracts protocolFee when computing nonClaimableTokens.The text was updated successfully, but these errors were encountered: