Skip to content
Business logic Audit finding Intermediate

User can make their `veNFT` unpokeable by voting for a to-be-killed gauge

A user can make their veNFT unpokeable by voting a small amount to a gauge that is about to be killed, because the poke function reverts when it encounters a dead gauge. This allows the user's outdated voting power to persist, giving their chosen pool more emissions and themselves more bribes than deserved.

bughuntoor Follow with eeyore

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-06-velocimeter-judging/issues/208

Found by

bughuntoor, eeyore

Summary

Vulnerability Detail

In order to understand the impact of the issue, we need to first understand why poke is critical to the system. When users vote for a pool of their choice, they contribute with the current balance of their veNFT. As the veNFT balance is linearly decaying, this results in possible outdated votes. For example: if a user has voted with a veNFT which has 10 weeks until unlock_time and 9 weeks have passed without anyone poking or revoting the veNFT, it will still be contributing with the balance from 9 weeks ago, despite the current balance being 10x less.

For this reason poking is introduced, so if a NFT has not been updated in a long time, admins can do it (usually in other protocols like Velodrome, poking is unrestricted and anyone can do it to make it fair for all users)

A user can make their veNFT unpokeable in the following way:

  1. Gauge is known that it will soon be killed
  2. User votes most of their weight to the pool they'd like and a dust amount to the to-be-killed gauge.
  3. As soon as the gauge is killed, user's veNFT becomes unpokeable due to the following check in _vote:
Solidity
            if (isGauge[_gauge]) {
                require(isAlive[_gauge], "gauge already dead");

Impact

User's gauge of choice will receive more emissions than supposed to. User will receive more bribes than supposed to.

Code Snippet

https://github.com/sherlock-audit/2024-06-velocimeter/blob/main/v4-contracts/contracts/Voter.sol#L266

Tool used

Manual Review

Recommendation

If gauge is killed, instead of reverting, continue

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/Velocimeter/v4-contracts/pull/21

spacegliderrrr

Fix looks good. Function now does not revert in case the gauge is killed.

sherlock-admin2

The Lead Senior Watson signed off on the fix.

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

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 poke function reverts when it encounters a dead gauge instead of skipping it, allowing a user to block poking by voting for a gauge that will be killed.

Impact

The user's chosen gauge receives more emissions than it should, and the user receives more bribes than they are entitled to.

What the attacker needed

A veNFT with voting power; knowledge of a gauge that will be killed

The fix

The issue was fixed by changing the code to skip dead gauges instead of reverting.

How it was found

  1. Identify a gauge that will soon be killed.
  2. Vote most weight to the desired pool and a dust amount to the to-be-killed gauge.
  3. After the gauge is killed, the veNFT becomes unpokeable because the poke call reverts.

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 veNFT is a voting token whose power decreases over time. Normally, an admin can 'poke' it to update its voting power. The bug lets a user prevent poking by adding a vote to a gauge that is about to be removed, so the update fails and their old, higher voting power stays active unfairly.

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 bughuntoor

View all

16 more disclosed reports, best first.

More from Velocimeter

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.