-
Notifications
You must be signed in to change notification settings - Fork 0
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
recoverERC20 can be used by the owner as a backdoor to retrieve the rewardsToken #40
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-68
satisfactory
satisfies C4 submission criteria; eligible for awards
Comments
Duplicate of #17 |
kirk-baird marked the issue as not a duplicate |
kirk-baird marked the issue as duplicate |
kirk-baird marked the issue as satisfactory |
kirk-baird marked the issue as not a duplicate |
kirk-baird marked the issue as duplicate of #17 |
Simon-Busch marked the issue as duplicate of #68 |
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-68
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2022-10-paladin/blob/d6d0c0e57ad80f15e9691086c9c7270d4ccfe0e6/contracts/WardenPledge.sol#L653-L662
Vulnerability details
Impact
The
recoverERC20 ()
function is used to recover tokens sent to the contract by mistake. The contract requires one parametertoken
and can only be called by the owner. However, from the function code, the contract owner can use this function to recover any token including therewardsToken
used in the contract as there is no check to prevent this from happening from the code snippet shown below:As a result, users can lose all their rewards to a malicious or compromised
owner
.Proof of Concept
https://github.com/code-423n4/2022-10-paladin/blob/d6d0c0e57ad80f15e9691086c9c7270d4ccfe0e6/contracts/WardenPledge.sol#L653-L662
Tools Used
Recommended Mitigation Steps
Consider implementing this function as follows:
References
StakingRewards.sol
recoverERC20()
can be used as a backdoor by theowner
to retrieverewardsToken
2022-02-concur-findings#210rewardsToken
2022-02-concur-findings#69The text was updated successfully, but these errors were encountered: