Skip to content
Last updated: February 06, 2026

SCWE-121: Swallowed Revert Reasons

Stable Version v1.0

This content is in the version-(v1.0) and still under active development, so it is subject to change any time (e.g. structure, IDs, content, URLs, etc.).

Send Feedback

Relationships

Description

Ignoring revert data (e.g., using require(ok) without bubbling reason) hides the root cause of failures. Protocols may proceed under incorrect assumptions, misprice risk, or block user funds without actionable errors.

Remediation

  • Bubble revert reasons from external calls ((bool ok, bytes memory data), then assembly { revert(add(data,32), mload(data)) } when !ok).
  • Standardize error handling with custom errors and propagate upstream.
  • Emit diagnostics when external calls fail to aid monitoring.

Examples

Vulnerable

pragma solidity ^0.8.0;

(bool ok, ) = target.call(payload);
require(ok, "call failed"); // hides real reason

Fixed

pragma solidity ^0.8.0;

(bool ok, bytes memory data) = target.call(payload);
if (!ok) {
    assembly {
        revert(add(data, 32), mload(data))
    }
}