Pledges that contain delisted tokens can be extended to continue using delisted reward tokens
The pledge extension function did not verify that the reward token was still whitelisted, so a creator could extend an existing pledge indefinitely using a delisted token. This bypassed the whitelist, potentially allowing a malicious token to remain in use after removal.
Submitted by 0x52, also found by bin2chen
Delisted reward tokens can continue to be used by extending current pledges that already use it.
Proof of Concept
if(pledgeId >= pledgesIndex()) revert Errors.InvalidPledgeID();
address creator = pledgeOwner[pledgeId];
if(msg.sender != creator) revert Errors.NotPledgeCreator();
Pledge storage pledgeParams = pledges[pledgeId];
if(pledgeParams.closed) revert Errors.PledgeClosed();
if(pledgeParams.endTimestamp <= block.timestamp) revert Errors.ExpiredPledge();
if(newEndTimestamp == 0) revert Errors.NullEndTimestamp();
uint256 oldEndTimestamp = pledgeParams.endTimestamp;
if(newEndTimestamp != _getRoundedTimestamp(newEndTimestamp) || newEndTimestamp < oldEndTimestamp) revert Errors.InvalidEndTimestamp();
uint256 addedDuration = newEndTimestamp - oldEndTimestamp;
if(addedDuration < minDelegationTime) revert Errors.DurationTooShort();
uint256 totalRewardAmount = (pledgeParams.rewardPerVote * pledgeParams.votesDifference * addedDuration) / UNIT;
uint256 feeAmount = (totalRewardAmount * protocalFeeRatio) / MAX_PCT ;
if(totalRewardAmount > maxTotalRewardAmount) revert Errors.IncorrectMaxTotalRewardAmount();
if(feeAmount > maxFeeAmount) revert Errors.IncorrectMaxFeeAmount();
During the input validation checks, it’s never checked that reward token of the pledge being extended is still a valid reward token. This would allow creators using delisted tokens to continue using them as long as they wanted, by simply extending their currently active pledges.
Recommended Mitigation Steps
Add the following check during the input validation block:
+ if(minAmountRewardToken[rewardToken] == 0) revert Errors.TokenNotWhitelisted();
Kogaroshi (Paladin) confirmed, resolved, and commented:
I consider this a valid Medium risk as pledges can be extended indefinitely. It bypasses the whitelisting which may be damaging if a token is found to be malicious and removed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The extension function lacked a check that the pledge's reward token is still whitelisted.
Impact
A creator could extend a pledge indefinitely with a delisted token, bypassing the whitelist, which may be damaging if the token was removed for being malicious.
What the attacker needed
Creator owns an active pledge; pledge uses a token that later gets delisted
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A whitelist is a list of tokens the system allows. When a token is removed from that list, it should no longer be usable. The bug meant that if you already had a pledge using a removed token, you could keep extending it, so the removal had no effect.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.