Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: medium
Valid

Withdraw All Of The Funds

Summary

In the LLMOracleCoordinator::withdrawPlatformFees function, the admin has the ability to withdraw all tokens held by the contract. This capability poses significant risks, as the admin could deplete the contract's funds, preventing validators and generators from withdrawing their due rewards.

Vulnerability Details

Consider the following scenario:

  1. The contract owner withdraws all token amounts from the contract.

  2. A validator attempts to withdraw their earned fees.

  3. With no funds left in the contract, the validator is unable to receive their reward for validating generator responses.

Potentially leading to decreased participation and trust in the system.

Impact

The admin's ability to drain the contract can result in validators and responders losing trust in the system because they can't withdraw their funds.

Tools Used

Manual Review

Recommendations

Addressing this vulnerability is crucial, and while the fix is not trivial, a viable solution involves implementing a mechanism to track fees allocated to validators and responders.
Here's a proposed modification to the withdrawPlatformFees function:

function withdrawPlatformFees() public onlyOwner {
uint256 totalFees = feeToken.balanceOf(address(this));
require(totalFees > allocatedFees, "Insufficient available fees to withdraw");
feeToken.transfer(owner(), totalFees - allocatedFees);
}

This ensures that the owner can only withdraw funds that do not affect the rewards due to validators and responders, preserving the integrity of the contract and its ecosystem.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Validated
Assigned finding tags:

`withdrawPlatformFees` withdraws the entire balance

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.