Skip to content
DoS Audit finding Advanced

Improper Error Handling of onClaim Callback in _claim Function

The internal _claim function wraps an external onClaim callback in a try/catch, but handles failures inconsistently: an unexpected return value causes an uncaught revert inside the try block, while a genuine external call failure is silently swallowed by an empty catch. A malformed or malicious recipient could therefore either abort an entire claim batch or bypass intended callback logic.

Merkl with Ahmerdrarerh, ayushblock and 10 others

Originally disclosed on Code4rena

Found by V12; also found by Ahmerdrarerh, ayushblock, Bala1796, dantehrani, fathomhewclaim, grey, Guilherme, mrdafidi, Obito, rox_k, SpicyMeatball, and Supheli

The Distributor contract’s internal _claim function uses a try/catch to isolate failures in an external onClaim callback, but misplaces and asymmetrically handles reverts and invalid return values. As implemented, successful external calls that return an unexpected magic value trigger a revert inside the try block (uncaught), while genuine external call failures are silently swallowed in the empty catch. This leads to inconsistent and undesirable outcomes: a malformed or malicious recipient can either block the entire batch or bypass critical post-claim logic.

Root cause

The try/catch surrounding the IClaimRecipient.onClaim callback is scoped only to the external call. Reverts or invalid returns detected inside the try success handler are not caught by the empty catch, and genuine external call failures are suppressed, resulting in both swallowed errors and uncaught reverts.

Impact

  1. A malicious or buggy onClaim implementation can return an incorrect value, triggering an uncaught revert that aborts the entire claim batch and undoes successful token transfers (DOS risk and user fund rollback).
  2. Conversely, a reverting onClaim call is silently ignored, allowing recipients to bypass intended callback logic (e.g., audit hooks or state updates), undermining protocol invariants.

The original report as published on Code4rena. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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 try/catch only wraps the external call itself, so reverts raised inside the try success handler are not caught, and the empty catch suppresses genuine external call failures.

Impact

A malicious or buggy onClaim implementation could abort an entire claim batch and roll back successful transfers, or silently bypass intended callback logic; the text does not state that a fix was applied.

What the attacker needed

A recipient contract implementing onClaim; recipient returns an unexpected value or reverts

The fix

The callback handling should be restructured so that invalid return values and external call failures are both caught and handled consistently, rather than reverting inside the try block or being silently swallowed.

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 here calls out to another contract to notify it that a claim happened. The code tries to catch problems with that call, but the safety net is in the wrong place: one kind of problem crashes the whole batch, and another kind is ignored completely. That means a badly behaved recipient contract can either block everyone else's claims or skip checks the protocol expected to run.

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.

More from Merkl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.