[web3] A Very Helpful Sign - zzykxx's blog
The merge function in Thena's veNFT contract incorrectly increased the total supply variable when combining two NFTs, even though the total locked tokens should remain unchanged. An attacker could repeatedly merge NFTs to inflate the supply, potentially lowering weekly emissions, causing a denial of service on rewards, or increasing the share of emissions given to veNFT holders.
zzykxx.com
Published on zzykxx.com
I was trying to exploit a function in Thena protocol that allows users to merge two NFTs into one. It’s a functionality I haven’t seen before, so I thought it could be a soft spot worth investigating.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could lower weekly emissions, cause a denial of service on weekly rewards by underflow, or increase the share of emissions given to veNFT holders up to a maximum.
What the attacker needed
Own at least two veNFTs
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 write-up has not been written yet. The Original tab links to the source.
In this system, users lock tokens to get voting power represented by NFTs. The total amount of locked tokens is tracked by a variable called supply. When two NFTs are merged, the code mistakenly adds the merged amount to supply again, even though those tokens were already counted. By merging repeatedly, an attacker can make the system think more tokens are locked than actually are, which can mess up reward calculations.
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.