Dria

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

No Slashing Mechanism Allows Malicious Oracles to Exit Without Consequences

Vulnerability Details

The LLMOracleRegistry implements a staking mechanism but lacks any slashing mechanism or timelock delay for unstaking. This allows malicious oracles to:

  1. Register as an oracle by staking tokens

  2. Act maliciously (e.g., provide incorrect responses/validations)

  3. Immediately unregister and withdraw their entire stake before any penalties can be applied

The issue occurs in the unregister() function which has no delay or conditions:

LLMOracleRegistry.sol#L113-L131

/// @notice Remove registration of an Oracle.
/// @dev Reverts if the user is not registered.
/// @param kind The kind of Oracle to unregister.
/// @return amount Amount of stake approved back.
function unregister(LLMOracleKind kind) public returns (uint256 amount) {
amount = registrations[msg.sender][kind];
// ensure the user is registered
if (amount == 0) {
revert NotRegistered(msg.sender);
}
// unregister the user
delete registrations[msg.sender][kind];
emit Unregistered(msg.sender, kind);
// approve its stake back
token.approve(msg.sender, token.allowance(address(this), msg.sender) + amount);
}

While the protocol relies on Proof-of-Work as a security measure, this only prevents spam but does not ensure honest behavior. A malicious oracle with sufficient computational power could still:

  1. Submit incorrect responses that pass PoW verification

  2. Have their validator address validate these incorrect responses

  3. Immediately unregister both addresses and withdraw their stakes

  4. Keep all earned fees while damaging the protocol's integrity

Impact

  1. No economic penalties for malicious behavior

  2. Oracles can act maliciously without risking their stake

  3. The protocol's quality assurance relies solely on PoW which only prevents spam

  4. Malicious oracles can damage the protocol's reputation and still recover their full stake

  5. This undermines the entire staking mechanism's purpose of ensuring honest behavior

Recommendations

  1. Add a timelock delay (e.g., 7 days) between requesting unstake and being able to withdraw

  2. Implement a slashing mechanism for provably malicious behavior

  3. Consider a reputation system where oracles build up trust over time

  4. Add a dispute period during the unstaking timelock where other participants can flag malicious behavior

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

There is no oracle whitelisting

Support

FAQs

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