RngRelayAuction.rngComplete() DOS attack
The rngComplete function transfers prize tokens directly to recipients, so if a recipient is blacklisted by the token (e.g., USDC), the transfer reverts and blocks the entire function. An attacker could exploit this to cause a denial of service by getting a recipient blacklisted.
bin2chen Follow with 0xbepresent and MatricksDeCoder
Originally disclosed on Code4rena
Submitted by bin2chen, also found by 0xbepresent and MatricksDeCoder
If the recipient maliciously enters the blacklist of priceToken, it may cause rngComplete() to fail to execute successfully.
Proof of Concept
The current implementation of RngRelayAuction.rngComplete() immediately transfers the prizeToken to the recipient.
function rngComplete(
uint256 _randomNumber,
uint256 _rngCompletedAt,
address _rewardRecipient,
uint32 _sequenceId,
AuctionResult calldata _rngAuctionResult
) external returns (bytes32) {
...
for (uint8 i = 0; i < _rewards.length; i++) {
uint104 _reward = uint104(_rewards[i]);
if (_reward > 0) {
@> prizePool.withdrawReserve(auctionResults[i].recipient, _reward);
emit AuctionRewardDistributed(_sequenceId, auctionResults[i].recipient, i, _reward);
}
}
contract PrizePool is TieredLiquidityDistributor {
function withdrawReserve(address _to, uint104 _amount) external onlyDrawManager {
if (_amount > _reserve) {
revert InsufficientReserve(_amount, _reserve);
}
_reserve -= _amount;
@> _transfer(_to, _amount);
emit WithdrawReserve(_to, _amount);
}
function _transfer(address _to, uint256 _amount) internal {
_totalWithdrawn += _amount;
@> prizeToken.safeTransfer(_to, _amount);
}
There is a risk that if prizeToken is a token with a blacklisting mechanism, such as :USDC.
Then recipient can block rngComplete() by maliciously entering the USDC blacklist.
Since RngAuctionRelayer supports AddressRemapper, users can more simply specify blacklisted addresses via remapTo()
Recommended Mitigation Steps
Add claims mechanism, rngComplete() only record cliamable[token][user]+=rewards.
Users themselves go to claims.
Assessed type
Context
asselstine (PoolTogether) confirmed
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 function performs token transfers in a loop without handling transfer failures, so a single blacklisted recipient causes the entire transaction to revert.
Impact
An attacker could block the rngComplete function, preventing prize distribution and potentially disrupting the protocol's operation.
What the attacker needed
PrizeToken supports blacklisting (e.g., USDC); attacker can get a recipient address blacklisted
The fix
The function should record claimable rewards instead of transferring tokens directly, allowing users to claim them later.
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.
Some tokens, like USDC, can block specific addresses from sending or receiving them. If a prize winner's address is blocked, the prize payout fails, and because the code pays all winners in one go, the whole payout process stops. An attacker could deliberately get an address blocked to prevent prizes from being 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.