Skip to content
Business logic Audit finding Intermediate

Adversary can block NFT distribution on tiered bounties by assigning the NFTs to unused tiers

The deposit function for tiered bounties allows a user to specify any tier when depositing an NFT, without checking that the tier exists. An attacker can fill all NFT deposit slots with NFTs assigned to non-existent tiers, preventing legitimate NFT prizes from being added and claimed.

0x52 Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-02-openq-judging/issues/264

Found by

0x52

Summary

Bounties limit the number of NFT deposits to five. An adversary can block adding NFTs by assigning NFTs to tiers that don't exist.

Vulnerability Detail

https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L113-L131

DepositMangerV1#fundBountyNFT passes the user supplied _data to TieredBountyCore#receiveNft

https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/TieredBountyCore.sol#L41-L42

_data is decoded and stored in _tier allowing the user to specify any tier they wish.

An adversary can abuse this fill all eligible nft deposit slots with nfts that can't be claimed by any tier. This allows them to effectively disable nft prizes for any tiered bounty. Using a large enough tier will make it impossible to ever claim the nfts because it would cost too much gas to set a large enough payout schedule

Impact

Adversary can effectively disable nft prizes for any tiered bounty

Code Snippet

https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/TieredBountyCore.sol#L18-L48

Tool used

Manual Review

Recommendation

TieredBountyCore#receiveNFT should check that specified tier is a within bound (i.e. by comparing it to the length of tierWinners)

Discussion

IAm0x52

Not a dupe of #261 and a separate issue. This discusses supplying NFTs to the incorrect tiers of tiered bounties

hrishibhat

This issue was incorrectly duped with #261 and was missed during the processing of the initial results. This issue is a valid medium, and also unique. As mentioned above, the attacker can fill tiers large enough so that it is not possible to set the payout schedule for any tier due to out of gas.

jacksanford1

From Protocol Team:

We no longer have NFT funding at all, so [this issue is] no longer relevant.

Classifying this issue as "Won't Fix."

The original report as published on Sherlock, by 0x52. 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 contract fails to validate that the tier specified when depositing an NFT is within the bounds of existing tiers.

Impact

The attacker can effectively disable NFT prizes for any tiered bounty, as the NFTs cannot be claimed and legitimate deposits are blocked.

What the attacker needed

A tiered bounty with NFT deposits enabled; ability to call fundBountyNFT

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 tiered bounty lets people win prizes at different levels. The code that adds NFT prizes does not check that the chosen level actually exists. Someone can add NFTs to fake levels, using up all the allowed prize slots, so real prizes cannot be added.

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 0x52

View all

211 more disclosed reports, best first.

More from OpenQ

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.