Extension voting threshold check needs to rerun on each transfer
The Extension contract updates vote counts on token transfers but does not re-evaluate whether the extension's voting threshold has been met after the transfer. This can prevent an extension from being granted even when the new token holder's votes would push total support over the threshold.
Submitted by cmichel
The Extension contract correctly reduces votes from the from address of a transfer and adds it to the to address of the transfer (in case both of them voted on it before), but it does not rerun the voting logic in voteOnExtension that actually grants the extension. This leads to issues where an extension should be granted but is not:
POC
toaddress has 100 tokens and votes for the extensionfromaddress has 100 tokens but does not vote for the extension and transfers the 100 tokens tototonow has 200 tokens,removeVotesis run, thetotalExtensionSupportis increased by 100 to 200. In theory, the threshold is reached and the vote should pass iftocould callvoteOnExtensionagain.- But their call to
voteOnExtensionwith the new balance will fail as they already voted on it (lastVotedExtension == _extensionVoteEndTime). The extension is not granted.
Impact
Extensions that should be granted after a token transfer are not granted.
Recommended Mitigation Steps
Rerun the threshold logic in removeVotes as it has the potential to increase the total support if to voted for the extension but from did not.
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
Likely the vote-counting logic in `removeVotes` does not re-check the threshold after updating support, so a transfer that increases total support does not trigger the granting of the extension.
Impact
Extensions that should be granted after a token transfer are not granted.
What the attacker needed
Token holders can vote on extensions; a transfer increases total support
How it was found
- The `to` address has 100 tokens and votes for the extension.
- The `from` address has 100 tokens, does not vote, and transfers the 100 tokens to `to`.
- `to` now has 200 tokens; `removeVotes` runs and increases `totalExtensionSupport` by 100 to 200.
- The threshold is reached, but `to` cannot vote again because they already voted (`lastVotedExtension == _extensionVoteEndTime`).
- The extension is not granted.
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.
When tokens move between people, the contract adjusts the votes for an extension, but it forgets to check again if enough votes now exist to pass. So an extension that should pass after a transfer might not get approved.
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.