NFT not minted when contributed via a supported payment terminal
A Juicebox project can accept payments in multiple currencies via different payment terminals, but the NFT delegate only supports one pricing currency. If a payment is made in another currency and no price feed is configured, the delegate silently returns without minting the NFT, even if the contribution would have qualified for a tier.
Submitted by Jeiwan, also found by cccz
A contributor won’t get an NFT they’re eligible for if the payment is made through a payment terminal that’s supported by the project but not by the NFT delegate.
Proof of Concept
A Juicebox project can use multiple payment terminals to receive contributions (JBController.sol#L441-L442). Payment terminals are single token payment terminals (JBPayoutRedemptionPaymentTerminal.sol#L310) that support only one currency (JBSingleTokenPaymentTerminal.sol#L124-L132). Since projects can have multiple terminals, they can receive payments in multiple currencies.
However, the NFT delegate supports only one currency (JBTiered721Delegate.sol#L225):
function initialize(
uint256 _projectId,
IJBDirectory _directory,
string memory _name,
string memory _symbol,
IJBFundingCycleStore _fundingCycleStore,
string memory _baseUri,
IJBTokenUriResolver _tokenUriResolver,
string memory _contractUri,
JB721PricingParams memory _pricing,
IJBTiered721DelegateStore _store,
JBTiered721Flags memory _flags
) public override {
// Make the original un-initializable.
require(address(this) != codeOrigin);
// Stop re-initialization.
require(address(store) == address(0));
// Initialize the sub class.
JB721Delegate._initialize(_projectId, _directory, _name, _symbol);
fundingCycleStore = _fundingCycleStore;
store = _store;
pricingCurrency = _pricing.currency; // @audit only one currency is supported
pricingDecimals = _pricing.decimals;
prices = _pricing.prices;
...
}
When a payment is made in a currency that’s supported by the project (via one of its terminals) but not by the NFT delegate, there’s an attempt to convert the currency to a supported one (JBTiered721Delegate.sol#L527-L534):
if (_data.amount.currency == pricingCurrency) _value = _data.amount.value;
else if (prices != IJBPrices(address(0)))
_value = PRBMath.mulDiv(
_data.amount.value,
10**pricingDecimals,
prices.priceFor(_data.amount.currency, pricingCurrency, _data.amount.decimals)
);
else return;
However, since prices is optional (it can be set to the zero address, as seen from the snippet), the conversion step can be skipped. When this happens, the contributor gets no NFT due to the early return even though the amount of their contribution might still be eligible for a tiered NFT.
Recommended Mitigation Steps
Short term, consider reverting when a different currency is used and prices is not set. Long term, consider supporting multiple currencies in the NFT delegate.
drgorillamd (Juicebox DAO) disputed
This is poor project management from the project owner (not adding the appropriate price feed), not a vulnerability
And there is no revert here as to not freeze the Juicebox project (NFT reward is an add-on, there is a full project running behind)
As this finding:
- would lead to a leak of value
- is conditional on the project owner’s mistake (that seems not so unlikely as they may think that one currency is enough and that they don’t need to set
prices)- but ultimately lead to a loss of funds for users
I believe Medium severity to be appropriate
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 NFT delegate only supports a single pricing currency and, when a different currency is used without a configured price feed, it silently returns instead of reverting or handling the conversion.
Impact
A contributor may not receive an NFT they are eligible for, leading to a loss of value for users; the project owner's failure to set a price feed is a precondition.
What the attacker needed
Project uses multiple payment terminals; NFT delegate supports only one currency; no price feed configured (prices set to zero); contributor pays in a different currency
The fix
The report recommends reverting when a different currency is used and no price feed is set, and longer term supporting multiple currencies in the NFT delegate.
How it was found
- A project configures multiple payment terminals to accept contributions in different currencies.
- The project's NFT delegate is set up with a single pricing currency and no price feed (prices set to zero address).
- A contributor pays through a terminal using a currency different from the delegate's pricing currency.
- The delegate attempts to convert the amount but finds no price feed, so it returns early without minting an NFT.
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 project can take payments in different currencies, but its NFT reward system only understands one currency. If someone pays in a different currency and the project hasn't set up a way to convert prices, the system just skips giving the NFT. The contributor loses out on a reward they should have received.
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.