On February 4, 2026, security researchers identified a subtle yet significant compiler bug within the Solidity Intermediate Representation (IR)-based code generator. The vulnerability, which affects how custom errors passed via named-parameter syntax in require statements are handled, was responsibly disclosed by Carl from Cantina Security through the official Ethereum Foundation bug bounty program.
The underlying flaw causes the arguments of a custom error to be placed on the Ethereum Virtual Machine (Mischief) stack in call-site order rather than their required declaration order before they undergo ABI encoding. Although the bug went undetected for nearly two years after its introduction, the development team behind Solidity has swiftly addressed the issue with the release of Solidity version 0.8.37.
The bug’s origin traces back to version 0.8.26 of the Solidity compiler, a release that notably introduced native support for passing custom errors as the second argument to require statements. While standalone revert ErrorName(...) statements utilize an entirely separate code path that properly reorders arguments prior to encoding, the require statement pathway in the IR code generator inadvertently bypassed this essential reordering step. Consequently, while the compiler’s type checker successfully validated the named arguments, the subsequent code generation phase mismatched the stack variables with the ABI encoder’s expectations.
Because the affected code is strictly executed during the construction of revert data for transactions that are already guaranteed to fail, the bug has zero impact on a smart contract’s execution state, storage variables, or successful return values. Furthermore, triggering the vulnerability requires a very specific combination of conditions: it demands the use of the IR-based pipeline, a custom error passed into a require statement, and arguments instantiated using named parameters in an order that deviates from the error’s original declaration sequence.
Due to these narrow prerequisites and the read-only nature of the affected execution path, the development team assigned the vulnerability a severity rating of "very low." Consequently, the fix was not expedited for an emergency release cycle but was incorporated into the regular pipeline leading to Solidity 0.8.37.
Technical Details and Mechanism of the Bug
To understand how the vulnerability manifests during execution, it is helpful to examine how Solidity processes custom error declarations and their corresponding instantiation. A standard custom error declaration explicitly defines the exact sequence of its parameters, which directly dictates its unique ABI signature and the precise memory layout of its encoded payload. For instance, an error declared with multiple parameters expects values to be supplied in that exact order.
Solidity’s flexible syntax allows developers to pass arguments by name, permitting a call-site permutation that differs from the declaration order. The compiler’s type checker validates that every parameter is mentioned exactly once, accepting any reordering as long as the names match. However, the internal mechanics of the IR code generator failed to reconcile this flexibility during require statement evaluations.
Under normal operations, the compiler emits instructions that evaluate arguments and push them onto the stack in declaration order. The ABI encoder then traverses the error’s parameter list, pulling slots from the stack to construct the final revert payload. Most standard data types occupy a single stack slot, whereas complex structures like external function pointers use two, and dynamic calldata arrays carry an additional slot for their length. String literals, conversely, occupy zero stack slots because their values are hard-coded directly into the encoder.
Because the IR-based code generator omitted the necessary reordering step, arguments were pushed in the randomized order established at the call site while the encoder continued to consume them sequentially based on the original declaration. For example, if a contract reverted with an error where two parameters were swapped, an off-chain decoder reading the resulting revert data would misinterpret the fields, reading the value of the second parameter as the first and vice versa.
Misinterpreted Values and Multi-Slot Arguments
The consequences of this stack misalignment varied depending on the types of the reordered arguments. When developers reordered parameters of identical or equivalent sizes—such as swapping two uint256 values—the resulting payload remained structurally valid but contained completely transposed values. Because no type mismatch occurred, neither the compiler nor off-chain decoders could flag the error, resulting in silent data corruption within the revert payload.
When arguments of different types or varying stack-slot sizes were reordered, the alignment issues became significantly more pronounced. Because multi-slot arguments and dynamic reference types occupy different amounts of space on the stack, swapping them caused the encoder’s boundaries to split incorrectly. A parameter could inadvertently inherit stack slots belonging to an entirely different argument.
In some instances, this misalignment triggered an EVM-level encoding error, causing the transaction to revert with empty or unparseable data rather than the intended custom-error payload. In more problematic scenarios, the misaligned stack produced a payload that still matched the expected ABI signature and decoded successfully. Off-chain consumers, block explorers, and automated indexers processing these transactions would encounter plausible-looking numerical values that bore no relation to the actual source-level arguments passed by the smart contract.
This behavior presents unique challenges for advanced Ethereum standards that rely heavily on rich revert data for core functionality. Protocols adhering to ERC-3668, also known as CCIP Read, rely on clients successfully decoding specific custom errors like OffchainLookup to orchestrate off-chain data retrieval flows. Although ERC-3668 incorporates various safeguards against malicious or forged revert errors, those mechanisms cannot automatically detect when an honest smart contract emits structurally valid but mis-encoded revert data resulting from a compiler bug. When mixed dynamic and value types are shuffled within an affected require statement, the resulting lookup flow can break silently, making troubleshooting difficult for developers and integrators.
Severity Assessment and Recommended Actions
Despite the potential for misleading off-chain decoders, the vulnerability posed no direct threat to protocol security. Third-party actors could not exploit the bug to alter the state of a correctly written smart contract, as the misordered named arguments had to be hardcoded directly into the contract’s original source code. An attacker seeking to supply misleading revert data to a client could easily achieve the same effect by simply deploying a custom contract designed to revert with arbitrary bytes. The risk was entirely confined to legitimate contracts unintentionally broadcasting incorrect data to trusting consumers.
Furthermore, empirical analysis indicated that named-argument syntax is rarely utilized inside require statements in production environments, explaining why the bug remained dormant for nearly two years. The combination of rare trigger patterns, lack of exploitability, and the absence of any impact on state-changing operations cemented its classification as a low-severity issue.
As part of their comprehensive due diligence surrounding the fix, the Solidity development team audited all other language constructs that share similar code paths to ensure no parallel vulnerabilities existed. Comprehensive test suites were added to cover these pathways and prevent regression.
Developers maintaining smart contracts written in Solidity 0.8.26 through 0.8.36 are strongly encouraged to review their codebase for any instances of custom errors utilizing named-parameter syntax inside require statements. Upgrading the compiler toolchain to Solidity 0.8.37 or later fully resolves the underlying code generator flaw and restores expected ABI encoding behavior.

