processFees() may fail due to exceed gas limit
The processFees() function iterates over an unbounded array of held fees, which can grow large as fees are added. An attacker could cause the function to exceed the gas limit, preventing fee distribution.
Submitted by oyc_109, also found by 0x52, IllIllI, and pashov
Impact
The function processFees() in JBPayoutRedemptionPaymentTerminal.sol may fail due to unbounded loop over _heldFeesOf[_projectId]
_heldFeesOf[_projectId] can get very large due to the function _takeFeeFrom() where it pushes fees that should be paid to a specific beneficiary onto the array
_heldFeesOf[_projectId] could get large and cause a DOS condition where no fees can be distributed due to exceed of gas limit
Proof of Concept
for (uint256 _i = 0; _i < _heldFeeLength; ) {
// Get the fee amount.
uint256 _amount = _feeAmount(
_heldFees[_i].amount,
_heldFees[_i].fee,
_heldFees[_i].feeDiscount
);
mejango (Juicebox) acknowledged
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
Likely the lack of a bound on the array length when iterating in processFees(), allowing it to grow indefinitely.
Impact
No fees can be distributed because the transaction exceeds the gas limit, creating a denial-of-service condition.
What the attacker needed
Fees are added to the array repeatedly
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 smart contract function loops over a list that can grow without limit. If the list gets too long, the function runs out of gas and fails, so fees cannot be paid out.
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.