Skip to content
Business logic Audit finding Intermediate

ERC20ConvictionScore allows transfers to special TOTAL_GOVERNANCE_SCORE address

The ERC20ConvictionScore contract allows any user to transfer tokens to the special address used to track the total governance credit score, which then accumulates a credit score based on its balance. An attacker could inflate this total score, raising the quorum threshold and preventing proposals from passing.

FairSide contest

Originally disclosed on Code4rena

The credit score of the special address(type(uint160).max) is supposed to represent the sum of the credit scores of all users that are governors.

But, any user can directly transfer to this address, increasing its balance and accumulating a credit score in _updateConvictionScore(to=address(uint160.max), amount).

It’ll first write a snapshot of this address’ balance, which should be very low:

// in _updateConvictionScore
_writeCheckpoint(user, userNum, userNew) = _writeCheckpoint(TOTAL_GOVERNANCE_SCORE, userNum, checkpoints[user][userNum - 1].convictionScore + convictionDelta);

This address then accumulates a score based on its balance, which can be updated using updateConvictionScore(uint160.max) and breaks the invariant.

Increasing it might be useful for non-governors that don’t pass the voting threshold and want to grief the proposal voting system by increasing the quorumVotes threshold required for proposals to pass. By manipulating FairSideDAO.totalVotes, totalVotes can be arbitrarily inflated and break the voting mechanism as no proposals can reach the quorum (percentage of totalVotes) anymore.

Recommend disallowing transfers from/to this address. Or better, track the total governance credit score in a separate variable, not in an address.

fairside-core (FairSide) confirmed:

This is actually what #61 is meant to be used for. I would label this a medium-level finding as it would simply dilute the voting rights of users at the expense of permanently losing FSD, which should not be a viable vector.

fairside-core (FairSide) resolved:

Indirectly fixed by PR#10.

cemozerr (Judge) commented:

Labeling this as medium risk as it would not pose a threat to user funds yet stall the governance process.

The original report as published on Code4rena. 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

Likely the contract uses a regular address to store the aggregate governance score and does not prevent transfers to or from that address.

Impact

The inflated total score could raise the quorum so high that no proposal can pass, stalling governance, though the attacker permanently loses the transferred tokens.

What the attacker needed

Attacker holds FSD tokens; attacker is willing to lose tokens

The fix

The issue was indirectly fixed by a pull request, and the report recommends disallowing transfers to or from the special address or tracking the total score in a separate variable.

How it was found

  1. Transfer tokens to the special address that represents the total governance score.
  2. Call updateConvictionScore on that address to refresh its accumulated score.
  3. The total governance score becomes inflated, raising the quorum threshold for proposals.

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 credit score contract uses a special address to hold the combined voting power of all governors. Because anyone can send tokens to that address, they can artificially boost its score. This makes the total voting power look larger, so normal proposals can no longer reach the required quorum to pass.

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 from FairSide 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.