3 Dec 2026, Thu

Solidity v0.8.37 Released with Critical Bug Fixes, EVM Amsterdam Support, and Experimental SSA CFG Updates

The Solidity development team has officially announced the release of Solidity v0.8.37, a maintenance and feature-focused update that addresses several notable compiler bugs, introduces support for upcoming Ethereum Virtual Machine features, and expands on experimental code generation tooling. While primarily recognized as a bugfix release, version 0.8.37 includes three important security-related fixes, two additional miscompilation corrections, and adjustments to deprecation warnings for older features and legacy EVM environments.

As smart contract security remains paramount within the decentralized finance and broader blockchain ecosystems, the timely identification and patching of compiler anomalies continues to be a cornerstone of the Solidity project. The latest release reflects ongoing contributions from independent security researchers and community bug bounty participants, highlighting the resilience fostered through collaborative ecosystem auditing.

Important Bugfixes

Solidity v0.8.37 introduces fixes for three distinct bugs rated across varying severity levels. Among these, two carry low-to-medium security ratings, while another has been categorized as very low severity. These patches address underlying flaws in both the legacy evmasm and modern IR (Intermediate Representation) compiler pipelines.

Memory Byte Array Element Delete Clears 32 Bytes

The most prominent security-related fix in the v0.8.37 release targets a memory corruption vulnerability within the evmasm pipeline. When the delete operator was applied to a single element of a bytes array stored in memory, the compiler generated bytecode that wrote 32 zero bytes starting at the target element, rather than clearing exclusively the single byte requested.

This unexpected behavior caused the extra zero bytes to overwrite up to 31 bytes following the intended element. Depending on the memory layout of the contract, these overwritten bytes could affect subsequent elements within the same array or, if the target element was situated near the end of the array, corrupt adjacent data structures allocated in memory. The issue similarly impacted string values that underwent conversion to bytes.

Developers should note that the modern IR pipeline remains unaffected by this bug. Furthermore, the analogous manual assignment method—such as setting b[i] = 0—correctly clears precisely one byte across both compilation pipelines. All Solidity versions up to and including v0.8.36 are susceptible to this memory overwrite behavior when using the legacy pipeline.

The underlying vulnerability was responsibly disclosed by researcher shaheenfazim through the Ethereum Foundation’s bug bounty program, prompting a comprehensive technical write-up by the Solidity team.

Spill Slot Collision Across Mutual Recursion

The second medium-severity issue addressed in this release affects the stack-to-memory mover utilized within the IR compilation pipeline (--via-ir). Designed to circumvent the EVM’s strict stack depth limitations by relocating local variables to fixed memory offsets known as spill slots, the mechanism encountered an allocation flaw in specific call graph configurations involving mutual recursion.

Under these recursive conditions, the compiler reserved an insufficient number of slots. Consequently, local variables belonging to two separate functions could be assigned identical memory spill slots even when both variables were simultaneously live. This resulted in one variable being silently overwritten by another during execution.

This anomaly is closely related to an earlier unsound spill issue in mutually recursive functions that was patched in version 0.8.36. Contracts compiled using --via-ir across versions 0.7.2 through 0.8.36 are potentially affected. The bug was identified and reported by Ng Sze Hon via the Ethereum Foundation bug bounty program.

Misordered Named Parameters in Require with Custom Errors

The third security-related fix involves a parameter ordering error within the IR pipeline when handling custom errors constructed with named arguments and passed directly into require statements—for instance, evaluating expressions structured like require(condition, MyError(b: 2, a: 1)).

In affected versions, the arguments were placed onto the evaluation stack in the order they appeared at the call site rather than following their formal declaration order within the custom error definition. During subsequent ABI encoding, these arguments could be incorrectly matched with mismatched parameters, leading them to be misinterpreted as entirely different data types. Although the encoder successfully generated a structurally valid payload conforming to the expected error signature, the encoded data failed to reflect the actual values instantiated by the developer.

It is important to note that plain revert MyError(...) statements and other language constructs utilizing named parameters are entirely unaffected. Because this misbehavior only manifests within the revert data of transactions that are already failing and reverting, it has no impact on valid contract state transitions. The issue was brought to light by security researcher Carl from Cantina Security through the Ethereum Foundation bug bounty program.

Other Miscompilations

In addition to the primary security fixes, Solidity v0.8.37 resolves two smaller miscompilation issues that are not classified as security vulnerabilities.

The first fix addresses uninitialized internal function pointers stored in packed storage slots using the legacy evmasm pipeline. When a variable positioned after an uninitialized function pointer within the same storage slot held a non-zero value, reading the function pointer returned an erroneous value. This could cause equality comparisons between such an uninitialized pointer and a default-initialized local function pointer to evaluate as false, even though neither pointer had ever been assigned a valid address. The issue does not impact actual function execution calls made through pointers, manifesting only during specific, unassigned pointer comparisons. The Solidity team emphasizes that relying on internal function pointer equality is inherently fragile because their underlying values depend on exact bytecode generation and remain unstable across contract updates—a practice the compiler already warns against and plans to prohibit in future breaking releases.

The second non-security miscompilation fix involves constant evaluation within the IR pipeline. Previously, code computing the value of a user-defined constant was generated only once per contract, utilizing either checked or unchecked arithmetic based on whichever usage site appeared first in the source code. Subsequent usage sites reused this single evaluation block. For constants whose initializers overflowed their designated types, reads occurring within a checked context could fail to trigger the required overflow panic, while reads within an unchecked block could spuriously revert. Because the operands involved are entirely compile-time constants, the resulting behavior is deterministic and outside external manipulation. The realistic failure scenario involves unverified code containing insufficient test coverage, where the erroneous constant evaluation surfaces predictably during initial unit testing.

Notable Features and Changes

Solidity v0.8.37 brings notable improvements to experimental tooling, prepares for upcoming EVM upgrades, and continues the systematic removal of deprecated features.

SSA CFG Planning Stack Shuffler (Experimental)

The experimental SSA CFG code generator, introduced earlier in the development cycle, has received a significant upgrade to its stack management architecture. The code generator precomputes stack layouts for every instruction point in a program, relying on a stack shuffler to emit the necessary SWAP, DUP, POP, and PUSH instructions to transition between states.

While previous iterations utilized a greedy algorithm that executed local adjustments step-by-step, version 0.8.37 introduces a planning-based stack shuffler. The new mechanism constructs an explicit plan mapping current stack items to their target positions before executing the adjustments bottom-up. If an item falls outside the reach of basic SWAP or DUP primitives, the shuffler compresses the stack to reestablish reachability and initiates a revised plan. Initial benchmarks indicate that this structured approach is computationally more efficient while generating bytecode comparable in size to the legacy greedy method. The SSA CFG code generator remains experimental and can be enabled using the compiler flags --experimental --via-ssa-cfg.

Support for the SLOTNUM Opcode

Aligning with future EVM specifications, Solidity v0.8.37 adds support for the SLOTNUM opcode specified in EIP-7843 for the upcoming Amsterdam EVM version. This opcode returns the beacon chain slot number associated with the current execution block.

Developers can access this feature within Solidity via block.slotnum, which returns a uint64 type, or through the slotnum() builtin function within Yul and inline assembly blocks. The built-in SMTChecker has also been updated to support the new property. These features require compiling with --evm-version amsterdam. Beginning with the Amsterdam upgrade, slotnum is established as a reserved identifier within Yul.

Removals and Deprecations

As part of ongoing efforts to maintain a lean and sustainable codebase, version 0.8.37 completely removes two features previously restricted to experimental mode in v0.8.35: the Language Server Protocol mode (--lsp) and the Generic Solidity prototype (pragma experimental solidity). The LSP mode was unmaintained and did not align with the philosophy of housing standalone language tooling outside the core compiler repository. Similarly, Generic Solidity—an early prototype exploring compiler refactoring—has been superseded by solcore, a separate experimental repository intended to serve as the foundation for future production implementations.

Additionally, the experimental ABIEncoderV2 pragma now triggers a deprecation warning. Because ABI coder v2 became standard behavior with Solidity v0.8.0 following the introduction of pragma abicoder v2 in v0.7.4, the older pragma has long been redundant. Although its removal does not necessitate a breaking release, the deprecation warning provides projects—particularly those relying on older testing framework dependencies—adequate time to clean up their codebase.

Finally, continuing deprecation schedules initiated in version 0.8.31, official deprecation warnings have been added for legacy EVM versions including constantinople, petersburg, istanbul, and berlin, alongside the SMTChecker’s BMC engine.

How to Install and Upgrade

Developers looking to adopt Solidity v0.8.37 can access installation instructions through the official Solidity documentation portal. Precompiled binaries and release packages are available directly from the project’s GitHub repository.

When building the compiler from source code, users are advised to avoid automatically generated GitHub source archives and instead utilize the dedicated solidity_0.8.37.tar.gz source tarball or check out the official v0.8.37 git tag to ensure proper dependency management and build integrity.

Leave a Reply

Your email address will not be published. Required fields are marked *