The Ethereum Foundation has officially released Solidity 0.8.37, addressing a subtle compiler bug within the Intermediate Representation (IR)-based code generator. Discovered and reported on February 4, 2026, by security researcher Carl from Cantina Security via the Ethereum Foundation bug bounty program, the flaw affected how certain custom error arguments were handled during transaction reversions. Specifically, the issue impacted custom errors passed as the second argument to require statements when invoked using named-parameter syntax in a non-declaration order.
While the bug remained undetected for nearly two years—having originally been introduced in Solidity 0.8.26 alongside support for custom errors in require functions—its practical impact is limited. Developers utilizing standard position-based arguments, standalone revert statements, or the legacy code generation pipeline remained entirely unaffected. Due to these narrow trigger conditions and the read-only nature of the affected execution path, the development team assigned the issue a "very low" severity rating. Consequently, the fix was incorporated into the regular release cycle rather than requiring an expedited emergency patch.
Which Contracts Are Affected?
To trigger the bug, a smart contract must meet a highly specific set of criteria during compilation with the IR-based code generation pipeline. First, the contract must be compiled using Solidity versions ranging from 0.8.26 up to 0.8.36, utilizing the IR-based pipeline rather than the legacy compiler backend. Second, the code must implement a require statement that triggers a revert by passing a custom error as its second argument. Finally, that custom error must be instantiated using named-parameter syntax, and the arguments must be provided in an order that explicitly deviates from their original declaration sequence within the error definition.
Other language constructs, standard function calls, and alternative error-handling patterns that traverse similar compilation paths were thoroughly audited and verified as unaffected. Comprehensive test suites covering all adjacent code patterns were added to the Solidity codebase as part of the due diligence accompanying the release of version 0.8.37.
Technical Details
To understand how the misbehavior occurs, it is helpful to examine the lifecycle of error arguments from the source code level down to the construction of low-level revert data. A custom error declaration explicitly establishes the exact sequence of its parameters, which subsequently dictates both its ABI signature and the structural layout of its encoded payload. For instance, an error declared as error NamedArgsError(uint256 a, uint256 b); expects parameters in that precise order.
Solidity permits developers to instantiate errors using named arguments, allowing flexibility in the call-site syntax, such as require(false, NamedArgsError(b: 7, a: 2));. Because the compiler binds these named inputs to parameters by name, the type checker accepts any permutation as long as every parameter is explicitly matched once. However, a disconnect existed within the IR-based code generator. While standalone revert ErrorName(...) statements correctly reordered arguments before ABI encoding, the specialized require-with-custom-error code path omitted this crucial reordering step.
Instead, the compiler emitted instructions that evaluated and pushed arguments onto the stack in the exact order they appeared at the call site. The ABI encoder, conversely, blindly consumed the stack slots according to the original declaration order. In the case of the snippet above, the resulting transaction revert payload placed the value of b in the first word and a in the second word. Consequently, off-chain decoders reading the on-chain revert data would interpret the values as a = 7 and b = 2, completely reversing the intended semantic meaning.
The severity of these misalignments varied depending on the data types involved. When developers reordered parameters of different types that coincidentally occupied the same number of stack slots—such as pairing a uint256 with an address—the transaction produced a structurally valid ABI payload containing silently swapped values. The decoder would parse the data without throwing an error, presenting incorrect numerical or address data that looked entirely plausible on the surface.
The consequences became more severe when multi-slot arguments or dynamic reference types were involved. Each argument’s underlying slots arrived at the encoder grouped together, but because the encoder split the stack based on the declaration order, the boundaries between parameters shifted. For example, mixing string literals, calldata arrays, or memory structs could cause the encoder to misinterpret a value-type integer as a dynamic memory offset. This misalignment could trigger an EVM-level encoding failure, causing the transaction to revert with empty or unparseable data rather than the intended custom error. Alternatively, it could generate a malformed payload that coincidentally passed decoder checks while exposing completely erroneous application data.
Severity Assessment
The bug’s impact is fundamentally constrained because it exclusively affects the construction of revert data for transactions that are already slated to fail and revert. It exerts zero influence over contract storage state, successful transaction execution paths, return values, or external calls made prior to the revert. Because state changes are entirely rolled back during a revert, the risk is restricted to the information transmitted off-chain via the revert payload.
On-chain smart contracts can technically observe revert data using advanced patterns like try/catch blocks or low-level CALL opcodes, though branching logic dependent on specific custom error contents remains relatively uncommon in practice. The primary vulnerability lies in off-chain consumers—including block explorers, indexers, automated testing frameworks, and custom client applications—that decode the transaction revert payload to diagnose failures. When presented with misaligned or type-confused data, these systems may display misleading values to end users or developers.
Particular architectural standards, such as ERC-3668 for CCIP Read, rely heavily on clients correctly decoding specialized custom errors like OffchainLookup to orchestrate secure data retrieval workflows. Although ERC-3668 incorporates robust security mechanisms to guard against malicious or forged revert errors, those safeguards cannot automatically detect when an honest, correctly written contract emits structurally valid but mis-encoded revert data due to an underlying compiler defect. The potential for such protocols to misinterpret transaction failures heavily influenced the evaluation of the bug, underscoring the necessity for a complete compiler patch.
At the same time, the possibility of third-party exploitation is virtually nonexistent. An attacker cannot force a securely deployed contract to emit mis-encoded revert data unless the vulnerable source code—specifically featuring reordered named arguments within a require statement—was authored and deployed by the contract creators in the first place. Furthermore, an attacker wishing to spoof revert data can already achieve that objective trivially by deploying a custom contract designed to return arbitrary byte arrays. The risk profile is strictly confined to unsuspecting developers unknowingly compiling contracts with specific, rare syntactic patterns.
Given that named-argument syntax is infrequently utilized inside require statements, and the fact that the underlying defect persisted unobserved for nearly two years following the release of Solidity 0.8.26, the overall threat level remained minimal.
Recommended Actions
Developers maintaining Ethereum smart contracts are strongly encouraged to review their existing codebases to identify any instances where custom errors are instantiated using named parameters inside require statements. Project maintainers utilizing Solidity versions 0.8.26 through 0.8.36 should update their toolchains and compiler configurations to Solidity 0.8.37 or later. Upgrading ensures that any IR-generated revert payloads involving named custom error arguments adhere strictly to declaration ordering, eliminating the risk of payload corruption and ensuring reliable off-chain error decoding across all integrated tooling and developer environments.

