The attachToManagedNFT function updates the last voted timestamp of a managed NFT, preventing it from voting until the next epoch. An attacker can repeatedly create new locks with minimal amount and call attachToManagedNFT at each epoch start, forcing the managed NFT to vote for the same gauges and preventing it from changing or resetting its votes.
The VoterUpgradeableV2.sol contract has the function attachToManagedNFT(), users use it to delegate their veFNX voting power to a mVeNFT. One of the things this function does after receiving the new voting power is sub-call to _poke() and it will update the last voted timestamp of the mVeNFT.
At this point, the mVeNFT can’t trigger the vote function until the next epoch starts due to the _checkVoteDelay(). Even this check inside the vote() doesn’t help in this case.
if (!managedNFTManagerCache.isWhitelistedNFT(tokenId_)) {
_checkEndVoteWindow();
}
However, to make things worse this protocol is deployed on Blast transactions are too cheap malicious users can keep creating new locks every epoch with one wei in amount to bypass the zero check.
Then at the start of every new epoch (after the start of the voting window), just call attachToManagedNFT(). By doing this it keeps forcing the mVeNFT to vote to the same gauges.
Impact
DOS attack where mVeNFT can’t invoke the vote function to change the weight of gauges; mVeNFT can’t reset its votes.
Recommended Mitigation Steps
One solution is to not check the vote delay, However, I believe this comes with some trade-offs.
function vote(
uint256 tokenId_,
address[] calldata poolsVotes_,
uint256[] calldata weights_
) external nonReentrant onlyNftApprovedOrOwner(tokenId_) {
if (poolsVotes_.length != weights_.length) {
revert ArrayLengthMismatch();
}
bool x = managedNFTManagerCache.isWhitelistedNFT(tokenId_);
if (!x) {
_checkVoteDelay(tokenId_);
}
_checkStartVoteWindow();
IManagedNFTManager managedNFTManagerCache = IManagedNFTManager(managedNFTManager);
if (managedNFTManagerCache.isDisabledNFT(tokenId_)) {
revert DisabledManagedNft();
}
if (!x) {
_checkEndVoteWindow();
}
_vote(tokenId_, poolsVotes_, weights_);
_updateLastVotedTimestamp(tokenId_);
}
The _updateLastVotedTimestamp was not supposed to be in the _poke method, so cases like yours became possible.
/**
* @dev Updates the voting preferences for a given tokenId after changes in the system.
* @param tokenId_ The tokenId for which to update voting preferences.
*/
function _poke(uint256 tokenId_) internal {
//** code **//
_updateLastVotedTimestamp(tokenId_);
}
The original report as published on Code4rena, by Ch_301. 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.
Generating the AI write-up for this report.
This usually takes about 40 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
How it worked
Root cause
Likely, the _poke function called within attachToManagedNFT updates the last voted timestamp, which triggers the vote delay check and prevents the managed NFT from voting until the next epoch.
Impact
A denial-of-service attack where the mVeNFT cannot invoke the vote function to change gauge weights or reset its votes.
What the attacker needed
Ability to create locks with minimal amount; low transaction fees (Blast); timing at epoch start
How it was found
Create a new lock with a very small amount (e.g., 1 wei) to bypass the zero check.
At the start of each new epoch (after the voting window starts), call attachToManagedNFT() to delegate the new lock's voting power to the target mVeNFT.
This updates the mVeNFT's last voted timestamp, preventing it from voting until the next epoch.
Repeat each epoch to keep the mVeNFT unable to vote or reset its votes.
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.
Generating the AI write-up for this report.
This usually takes about 40 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
A managed NFT (mVeNFT) is a special token that holds voting power in a system. The function attachToManagedNFT is used to give voting power to this NFT, but it also updates a timestamp that blocks the NFT from voting again until the next epoch. An attacker can exploit this by repeatedly attaching new small locks to the same managed NFT, keeping it stuck and unable to vote for different gauges.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.