-
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
Malicious or hacked admin can drain all tokens #17
Comments
PoC of the Issue is correct, but Remediation brings another issue in the system: in the case of a malicious or bugged token that was whitelisted, and currently in use for a Pledge, that needs to be removed from the whitelist, this would be impossible because the contract balance won't be 0. Will look for an in-between that could prevent the scenario doing most of the damages to the system. |
Fixed in PR 2, commit
That way, admin has no way to touch any Pledge rewards or rug any funds, even after removing a token from the whitelist. |
kirk-baird marked the issue as satisfactory |
kirk-baird marked the issue as primary issue |
Simon-Busch marked the issue as duplicate of #68 |
Lines of code
https://github.com/code-423n4/2022-10-paladin/blob/main/contracts/WardenPledge.sol#L653-L661
https://github.com/code-423n4/2022-10-paladin/blob/main/contracts/WardenPledge.sol#L585-L592
Vulnerability details
Impact
Hacked or malicious admin can transfer all tokens of
WardenPledge
to himself.Proof of Concept
WardenPledge.recoverERC20
function allows to transfer tokens controlled by contract if the token is not whitelisted.The check
if(minAmountRewardToken[token] != 0) revert Errors.CannotRecoverToken();
is done to not allow admin to send tokens that are used for sending rewards to himself.But there is another function that allows admin to remove token from whitelisted.
Using this function admin can first remove token from whitelisted and then recover tokens to himself.
I believe this is important thing and protocol should secure this. Because even if admin is not malicious, but ownership somehow was hacked, this gives ability for the attacker to get all funds and pausing can't help here.
Tools Used
VsCode
Recommended Mitigation Steps
You can disallow to blocklist token if the
WardenPledge
balance is not 0.The text was updated successfully, but these errors were encountered: