Skip to content
Access control Audit finding Intermediate

Epoch voting restrictions bypassed via deposit_for() for blacklisted/non-whitelisted tokenID s

The vote function blocks non-whitelisted or blacklisted tokenIds from voting after an epoch ends, but the deposit_for function calls poke without those checks. A holder of such an NFT can therefore increase the weight of existing votes after the voting window closes by depositing more balance.

rayss Follow

Originally disclosed on Code4rena

Submitted by rayss

https://github.com/code-423n4/2025-05-blackhole/blob/92fff849d3b266e609e6d63478c4164d9f608e91/contracts/VoterV3.sol#L174

https://github.com/code-423n4/2025-05-blackhole/blob/92fff849d3b266e609e6d63478c4164d9f608e91/contracts/VotingEscrow.sol#L816

Finding description and impact

The vote function in VoterV3.sol restricts voting after the epoch ends, allowing only whitelisted tokenIds (NFTs) or those meeting specific conditions (i.e., IAutoVotingEscrowManager(avm).tokenIdToAVMId(_tokenId) == 0) to continue voting. However, this restriction can be bypassed because the deposit_for function, which internally calls poke—does not enforce these same checks. As a result, even holders of non-whitelisted or blacklisted tokenIds can call deposit_for after the epoch has ended. While this does not allow them to vote for new pools, it does let them increase the weight of their existing votes (i.e., the pools they had previously voted for) if their NFT balance has increased. This effectively constitutes a form of post-epoch voting and undermines the intended voting restrictions.

Since poke recalculates voting power based on the current NFT balance (uint256 _weight = IVotingEscrow(_ve).balanceOfNFT(_tokenId);), a user’s voting weight can increase if their NFT balance increases (which they can do by depositing). This allows them to effectively circumvent the protocol’s intended epoch-based voting restrictions and manipulate vote weights after the voting window closesons.

Proof of Concept

  1. Epoch ends: The protocol’s voting period finishes, and the vote function stops accepting new votes from non-whitelisted tokenIds.
  2. User with non-whitelisted NFT: Alice holds an NFT that is not whitelisted (i.e., blacklisted) and thus can’t vote through the vote function anymore.
  3. Alice calls deposit_for(): Although the epoch has ended and she cannot vote for new pools, Alice calls the deposit_for function with her NFT’s tokenId and passes an amount. This function internally triggers poke, which updates her vote weights.
  4. Boosting vote weights: This allows Alice to increase the weight of her existing votes (to previously selected pools). Additionally, Alice could strategically vote with minimal weights to multiple pools during the active epoch, and then after the epoch ends, call deposit_for() to amplify those votes using her updated (larger) NFT balance—bypassing intended vote limitations (e.g, The epoch ends).
  5. Votes updated: The protocol accepts the recalculated vote weights, allowing Alice to affect governance decisions even after the official voting period has ended.
  6. Poking should be only allowed when epoch is active.

Impact

  • Users with non-whitelisted or blacklisted NFTs can bypass epoch restrictions by using the poke function after the epoch period ends.
  • Unauthorized vote recasting allows these users to increase their voting power outside the designated voting window.
  • Malicious actors could unfairly influence governance proposals beyond intended timeframes.

Severity Justification

Access control is broken. This issue is of medium severity because it enables users to bypass the core voting restrictions enforced by the protocol. The vote() function is designed to block votes after the epoch ends unless specific conditions are met (such as the NFT being whitelisted or having no AVM mapping). However, the poke() function lacks these same restrictions, allowing users (including those with blacklisted or ineligible NFTs) to recast votes even after the epoch has concluded. Since poke() recalculates vote weights based on the current balance of the NFT, users can amplify their voting power post-deadline by increasing their NFT balance and calling deposit_for(), which calls poke. This undermines the intended finality of the voting period, introduces inconsistent access control, and opens the door for manipulation of governance outcomes.

Recommended mitigation steps

Implement the same epoch and whitelist checks in the poke function as in the vote function to prevent unauthorized vote recasting after the epoch ends.

Blackhole disputed


The original report as published on Code4rena, by rayss. 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 poke function, reached through deposit_for, recalculates vote weights without repeating the epoch and whitelist checks that the vote function enforces.

Impact

A holder of a non-whitelisted or blacklisted NFT could increase the weight of existing votes after the epoch ends, potentially influencing governance outcomes outside the intended window.

What the attacker needed

A non-whitelisted or blacklisted NFT tokenId; the voting epoch has ended; the NFT balance can be increased by depositing

The fix

The poke function should apply the same epoch and whitelist checks as the vote function.

How it was found

  1. Wait for the voting epoch to end.
  2. Hold an NFT tokenId that is not whitelisted or is blacklisted.
  3. Call deposit_for with that tokenId and an amount, which triggers poke.
  4. The recalculated vote weight is accepted, increasing the weight of previously chosen pools.

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.

In this governance system, people lock tokens as NFTs and vote on pools during fixed time windows called epochs. After an epoch ends, the contract is meant to stop certain NFTs from changing their votes. The report shows a second function that updates vote weights without applying that same stop, so someone can still boost their old votes after the deadline.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by rayss

View all

1 more disclosed report, best first.

More from Blackhole

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.