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

Pledge creators can be rug pulled anytime #106

Closed
code423n4 opened this issue Oct 29, 2022 · 7 comments
Closed

Pledge creators can be rug pulled anytime #106

code423n4 opened this issue Oct 29, 2022 · 7 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-68 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-10-paladin/blob/66f9fcc813e220906a13e779b3198891e30459cc/contracts/WardenPledge.sol#L653

Vulnerability details

Proof of Concept

When a user creates a new Pledge, the contract transfers the reward amount of rewardToken from his address to the contract’s address. The issue is that the contract allows the contract’s owner to just transfer those rewardTokens to himself anytime without having to delegate any boost to the Pledge creator.

Steps:

  1. A user creates a new Pledge and 1000 rewardToken are transferred from his wallet to the contract
  2. The contract owner calls removeRewardToken to set minAmountRewardToken[token] **=** *0*
  3. The contract owner calls recoverERC20 with the address of the rewardToken
  4. Now the 1000 rewardToken are in the owner’s wallet, without him joining the pledge and delegating any boost, while the contract is left with 0 rewardToken and no one can join that particular pledge anymore

Impact

This gives 100% power of the admin to steal any user’s “pledged” reward tokens any time. This can happen not only with a compromised owner wallet but with an owner that turned malicious also.

Recommendation

Remove the recoverERC20 functionality, since it is not needed for the protocol’s functionality and is only there to “Recovers ERC2O tokens sent by mistake to the contract”

@code423n4 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 Oct 29, 2022
code423n4 added a commit that referenced this issue Oct 29, 2022
@Kogaroshi
Copy link

Duplicate of #17

@Kogaroshi Kogaroshi marked this as a duplicate of #17 Oct 30, 2022
@Kogaroshi Kogaroshi added the duplicate This issue or pull request already exists label Oct 30, 2022
@c4-judge
Copy link
Contributor

kirk-baird marked the issue as not a duplicate

@c4-judge c4-judge removed the duplicate This issue or pull request already exists label Nov 10, 2022
@c4-judge
Copy link
Contributor

kirk-baird marked the issue as duplicate

@c4-judge c4-judge reopened this Nov 10, 2022
@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Nov 10, 2022
@c4-judge
Copy link
Contributor

kirk-baird marked the issue as satisfactory

@c4-judge
Copy link
Contributor

kirk-baird marked the issue as not a duplicate

@c4-judge
Copy link
Contributor

kirk-baird marked the issue as duplicate of #17

@c4-judge
Copy link
Contributor

c4-judge commented Dec 6, 2022

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
Projects
None yet
Development

No branches or pull requests

3 participants