Skip to content
Business logic Audit finding Intermediate

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.

0x52 Follow with bin2chen

Originally disclosed on Code4rena

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:

Fixed in PR 2, commit.

kirk-baird (judge) 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.


The original report as published on Code4rena, by 0x52. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by 0x52

View all

211 more disclosed reports, best first.

More from Paladin - Warden Pledges contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.