The UsdTokenSwapKeeper contract implements Chainlink's Data Streams lookup pattern for automated price-based swaps, but contains a critical security vulnerability in its validation flow between checkLog
and checkCallback
functions.
checkLog
function performs initial validations:
After validations pass, it reverts with StreamsLookup to fetch price data:
checkCallback
processes the price data but fails to re-validate:
The vulnerability stems from broken validation flow in the contract's StreamsLookup pattern. Critical checks performed in checkLog, like deadline and asset validation, vanish during the revert and callback cycle since checkCallback is marked as pure and automatically approves all requests. This prevents necessary state validation and creates a concerning scenario where callback data goes completely unchecked, violating Chainlink's fundamental security requirements for automation callbacks.
The core issue cascades from the modifier choice through the entire security architecture - the pure restriction blocks state reads, while the hardcoded true return bypasses all safeguards, leaving the contract exposed to multiple attack vectors through direct callback manipulation.
Direct Callback Exploitation: An attacker could bypass deadline/asset validations by directly calling checkCallback
Validation Race Condition: State could change between initial check and callback execution
Expired Request Execution: Stale or expired requests could be processed due to missing re-validation
This security flaw creates a critical vulnerability in the swap execution pipeline that could lead to substantial financial damage. By bypassing core validation checks, attackers can force through expired or invalid swaps, targeting mismatched assets and circumventing essential business logic. The severity is amplified because each successfully exploited transaction could result in direct monetary losses through execution of swaps at outdated prices or with incorrect asset pairings, fundamentally compromising the contract's role as a secure market making system.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.