Delegated NFTs that are withdrawn while still delegated will remain delegated even after burn
Burning a delegated NFT did not remove its delegation reference, leaving a stale entry in the delegation list. This caused bloat, wasted gas, and reduced the maximum number of real delegators.
Submitted by 0x52, also found by berndartmueller, IllIllI, kenzo, and rotcivegaf
VoteEscrowCore.sol#L1226-L1236
Burn NFTs remained delegated causing bloat and wasting gas.
Proof of Concept
VoteEscrowDelegation.sol doesn’t change the withdraw or _burn functions inherited from VoteEscrowCore.sol. These functions are ignorant of the delegation system and don’t properly remove the delegation when burning an NFT. The votes for the burned NFT will be removed but the reference will still be stored in the delegation list where it was last delegated. This creates a few issues. 1) It adds bloat to both getVotes and getPriorVotes because it adds a useless element that must be looped through. 2) The max number of users that can delegate to another NFT is 500 and the burned NFT takes up one of those spots reducing the number of real users that can delegate. 3) Adds gas cost when calling removeDelegation which adds gas cost to _transferFrom because removeElement has to cycle through a larger number of elements.
Recommended Mitigation Steps
Override _burn in VoteEscrowDelegation and add this.removeDelegation(_tokenId), similar to how it was done in _transferFrom.
Fixed. Ref: https://github.com/golom-protocol/contracts/commit/a30a50abe1aa677374bdbf68e1e81d80e1545563
I agree with the wardens and sponsor who rate this as medium. It does negatively impact the functioning of the protocol, but none of the reporting wardens have shown how it can be used as a direct attack vector IMO.
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 _burn function inherited from VoteEscrowCore.sol was not overridden in VoteEscrowDelegation.sol to call removeDelegation, so the delegation reference was never cleaned up.
Impact
The stale delegation entry adds bloat to vote queries, wastes gas, and reduces the number of real users who can delegate, but no direct attack vector was demonstrated.
What the attacker needed
A delegated NFT; the NFT is burned
The fix
Override _burn in VoteEscrowDelegation to call removeDelegation for the token ID, and this was fixed.
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 you delegate votes from one NFT to another, the system keeps a list of who is delegating. If you burn the NFT that was delegating, the system forgets to remove it from that list. The leftover entry wastes space and gas, and it counts against the limit of 500 delegators.
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.