The Solidity development team has officially released Solidity version 0.8.37, addressing a subtle and long-standing compiler bug residing within the intermediate representation (IR) based code generator. Discovered and reported earlier this year on February 4, 2026, the vulnerability centers around how custom errors are handled when passed as the second argument to require statements using named-parameter syntax.
The security flaw was brought to light by security researcher Carl from Cantina Security, who submitted the finding through the official Ethereum Foundation bug bounty program. According to the technical disclosures from the Solidity team, the issue originated in Solidity version 0.8.26—a release that first introduced support for incorporating custom errors directly into require statements to provide richer, more descriptive failure states. Because the bug was confined to a specific code path within the IR-based pipeline and only triggered under precise coding patterns involving out-of-order named parameters, it remained undetected for nearly two years before being flagged by the Cantina Security auditor.
Technical Details and Mechanics of the Bug
To understand how the bug manifests, one must look closely at how the Ethereum Virtual Machine (EVM) stack interacts with the Application Binary Interface (ABI) encoder. When a smart contract developer declares a custom error, the sequence of its parameters establishes a rigid ordering layout that dictates both its unique ABI signature and the exact byte arrangement of its encoded payload. For example, a custom error declared with two parameters in a specific sequence expects its inputs to be processed in that exact layout.
However, Solidity permits developers to invoke these custom errors using named-parameter syntax, allowing them to pass arguments out of their declared sequence. The compiler’s type checker successfully validates these permutations as long as every parameter is accounted for exactly once. Problems arose when the IR-based code generator handled require statements containing these out-of-order named arguments.
Under normal circumstances, standalone revert statements utilizing custom errors with named arguments correctly reorder the underlying variables before passing them to the ABI encoder. Unfortunately, the code path specifically engineered for require statements with custom errors inadvertently skipped this crucial reordering phase. Consequently, the compiler pushed the arguments onto the stack in the exact call-site order rather than the mandatory declaration order.
When the ABI encoder subsequently walked through the parameter list, it pulled items off the stack assuming they matched the original declaration sequence. This mismatch created silent data corruption or stack misalignments depending on the types of variables involved. If two parameters shared the same data type or occupied an identical number of stack slots, the transaction would revert with a payload containing inverted or swapped values. Off-chain consumers, block explorers, and automated indexers decoding the transaction logs would read plausible yet entirely incorrect data, completely unaware that the parameters had been transposed during compilation.
The consequences became even more pronounced when reordered arguments occupied a varying number of stack slots, such as mixing a dynamic memory string with a fixed-size integer. Because string literals occupy zero slots and dynamic calldata arrays require multiple slots for tracking offsets and lengths, the boundary lines between independent arguments collapsed. The encoder would mistakenly interpret an integer value as a memory offset or misread data lengths, leading to corrupted payloads, structural misalignment, or an immediate EVM-level encoding revert. In scenarios where the payload accidentally remained structurally valid, the contract emitted misleading error data that successfully passed decoding checks while carrying entirely erroneous values.
Severity Assessment and Potential Impact
Following a thorough investigation, the Solidity team assigned the bug a "very low" severity rating. The classification stems from the narrow set of conditions required to trigger the bug and the read-only nature of the affected execution path. Because the flaw exclusively impacts the construction of revert data for transactions that are already failing and destined to revert, it has zero impact on a smart contract’s state variables, storage integrity, successful return values, or subsequent external calls.
Furthermore, exploiting the bug via external third-party action is impossible. An attacker cannot force a correctly compiled and structured contract to exhibit this mis-encoding behavior unless the vulnerable, non-declaration-ordered named parameter pattern already exists natively within the target contract’s source code. Malicious actors wishing to feed misleading revert data to off-chain observers can already achieve the same effect by deploying an entirely custom contract engineered to revert with arbitrary byte sequences.
Despite its low severity designation, the development team acknowledged potential risks involving standards that rely heavily on descriptive revert data for core protocol logic. Protocols adhering to specifications like ERC-3668, commonly known as CCIP Read, depend on clients interpreting specific custom errors—such as OffchainLookup—to drive decentralized off-chain data retrieval flows. Because errors like OffchainLookup frequently combine dynamic and value types, an unaddressed reordering flaw in an affected contract’s require statement could generate cleanly decoding payloads with altered values, disrupting integration layers in ways that are difficult for automated monitoring tools to flag.
Recommended Actions and Mitigation
With the public rollout of Solidity 0.8.37, developers utilizing the IR-based code generation pipeline and incorporating custom errors within require statements are strongly encouraged to upgrade their compiler toolchains. While the named-parameter syntax inside require calls remains relatively uncommon in production codebases, upgrading eliminates any latent risk of silent argument mis-encoding. Projects maintaining complex codebases that make heavy use of custom errors alongside named parameters should review their test suites and verify that error payloads match expected off-chain decoding standards across all deployment environments.

