{"id":3637,"date":"2026-11-09T23:15:49","date_gmt":"2026-11-09T23:15:49","guid":{"rendered":"https:\/\/smartcryptosecurity.com\/?p=3637"},"modified":"2026-11-09T23:15:49","modified_gmt":"2026-11-09T23:15:49","slug":"solidity-v0-8-37-released-key-bugfixes-amsterdam-evm-support-and-experimental-ssa-cfg-updates","status":"publish","type":"post","link":"https:\/\/smartcryptosecurity.com\/?p=3637","title":{"rendered":"Solidity v0.8.37 Released: Key Bugfixes, Amsterdam EVM Support, and Experimental SSA CFG Updates"},"content":{"rendered":"<p>The Solidity development team has officially announced the release of Solidity v0.8.37, bringing a series of crucial bugfixes, important compiler adjustments, support for new Ethereum Virtual Machine (EVM) opcodes, and sweeping cleanups of deprecated features. While primarily functioning as a maintenance and stability release, version 0.8.37 addresses several low-to-medium severity bugs discovered through the Ethereum Foundation\u2019s bug bounty program, alongside notable experimental enhancements to the code generation pipeline.<\/p>\n<h3>Important Bugfixes<\/h3>\n<p>Solidity v0.8.37 resolves three significant bugs, accompanied by patches for two smaller miscompilations that do not pose direct security risks. These fixes target specific edge cases across both the legacy <code>evmasm<\/code> pipeline and the IR-based compilation pipeline, improving overall contract reliability and safety for developers deploying to the Ethereum network.<\/p>\n<h4>Memory Byte Array Element Delete Clears 32 Bytes<\/h4>\n<p>The most prominent security-related issue fixed in this release involves the <code>delete<\/code> operator when applied to an element of a <code>bytes<\/code> array stored in memory. In previous versions up to and including v0.8.36, the <code>evmasm<\/code> pipeline incorrectly wrote 32 zero bytes starting at the targeted array element instead of clearing only that single byte. <\/p>\n<p>As a result, this extra zero-byte padding inadvertently overwrote up to 31 subsequent bytes following the element. Depending on the array&#8217;s structure, these overwritten bytes could belong to later elements within the same array or, if the element resided near the end of the data structure, to entirely unrelated data allocated immediately afterward in memory. This unexpected behavior also affected <code>string<\/code> values that were converted into <code>bytes<\/code>. <\/p>\n<p>The development team confirmed that the IR pipeline remains entirely unaffected by this issue. Furthermore, equivalent direct assignments, such as writing <code>b[i] = 0<\/code>, have always correctly cleared precisely one byte across both compilation pipelines. This vulnerability was responsibly disclosed by community contributor shaheenfazim through the Ethereum Foundation&#8217;s bug bounty program.<\/p>\n<h4>Spill Slot Collision Across Mutual Recursion<\/h4>\n<p>The IR compilation pipeline utilizes a stack-to-memory mover mechanism designed to bypass the EVM\u2019s strict stack depth limit by relocating local variables to fixed memory offsets known as spill slots. However, a bug was identified in specific call graph configurations involving mutual recursion, where too few spill slots were reserved. <\/p>\n<p>This oversight allowed variables from two distinct functions to be assigned the exact same spill slot even when both variables could remain live simultaneously. Consequently, one variable would silently overwrite the data of the other, leading to unpredictable runtime execution. This issue is closely related to, though distinct from, the unsound spill bug in mutual recursion that was patched in version v0.8.36. The current fix applies to versions 0.7.2 through 0.8.36 when compiling with the <code>--via-ir<\/code> flag enabled. This bug was reported by Ng Sze Hon via the Ethereum Foundation&#8217;s bug bounty program.<\/p>\n<h4>Misordered Named Parameters in <code>require<\/code> with Custom Errors<\/h4>\n<p>Another notable bug fixed in the IR pipeline concerns the handling of custom errors constructed with named arguments when passed directly inside a <code>require<\/code> statement, such as <code>require(condition, MyError(b: 2, a: 1))<\/code>. Under affected versions, arguments were placed onto the stack in the order they appeared at the call site rather than their defined declaration order in the error structure.<\/p>\n<p>During the ABI encoding phase, these misplaced arguments could match with incorrect parameters, causing them to be misinterpreted as values of completely different types. While the encoder still produced a structurally valid payload matching the target error signature, the payload failed to reflect the actual values instantiated by the developer. Because this issue only affects the revert data of transactions that are already failing and reverting, it has no impact on valid contract state or successful transactions. The bug was reported by Carl from Cantina Security through the Ethereum Foundation&#8217;s bug bounty program.<\/p>\n<h3>Other Miscompilations<\/h3>\n<p>In addition to the primary security fixes, Solidity v0.8.37 addresses two additional miscompilation scenarios that, while not classified as direct security vulnerabilities, could cause unexpected behavior under specific programming patterns.<\/p>\n<p>The first fix targets uninitialized function pointers in packed storage within the <code>evmasm<\/code> pipeline. Previously, reading an uninitialized internal function pointer from a packed storage slot returned an incorrect value if a subsequent variable stored within the same slot held a non-zero value. This could result in a false evaluation during equality comparisons between such a pointer and a default-initialized local pointer, despite neither ever being explicitly assigned. The development team noted that triggering this behavior requires a very specific usage pattern and can be reliably caught through standard unit testing. Furthermore, internal function pointer comparisons remain fragile as their underlying values are inherently unstable across contract updates.<\/p>\n<p>The second fix resolves an issue in the IR pipeline regarding constants read within both checked and unchecked arithmetic contexts. Previously, code computing a constant&#8217;s value was generated only once per contract\u2014inheriting either checked or unchecked semantics based entirely on which use site was encountered first\u2014and shared across all subsequent references. For constants whose initializers overflowed their types, this sharing meant a read in a checked context might skip its required overflow panic, or a read inside an <code>unchecked<\/code> block might spuriously revert. Because the operands are compile-time constants, the behavior is deterministic and easily identifiable during testing.<\/p>\n<h3>Notable Features and Changes<\/h3>\n<p>Solidity v0.8.37 introduces several meaningful upgrades to compiler infrastructure, experimental features, and EVM compatibility standards.<\/p>\n<h4>SSA CFG Planning Stack Shuffler (Experimental)<\/h4>\n<p>The experimental SSA CFG code generator, which precomputes optimal stack layouts for every program point, has received a substantial upgrade. Previously relying on a greedy algorithm to emit <code>SWAP<\/code>, <code>DUP<\/code>, <code>POP<\/code>, and <code>PUSH<\/code> instructions step by step, the compiler now features a structured planning stack shuffler. The new mechanism builds an explicit map of current stack items to their target positions and executes the plan bottom-up. Initial benchmarks indicate that this planning approach is computationally more efficient than its predecessor while maintaining comparable bytecode sizes. The SSA CFG generator remains experimental and can be invoked using <code>--experimental --via-ssa-cfg<\/code>.<\/p>\n<h4>Support for the <code>SLOTNUM<\/code> Opcode<\/h4>\n<p>Looking forward toward future network upgrades, Solidity v0.8.37 adds native support for the <code>SLOTNUM<\/code> opcode introduced in the Amsterdam EVM version via EIP-7843. This opcode retrieves the beacon chain slot number of the current block. Developers can now access this value via <code>block.slotnum<\/code> (typed as <code>uint64<\/code>) in Solidity, or through the <code>slotnum()<\/code> built-in function within Yul and inline assembly when compiling with <code>--evm-version amsterdam<\/code>. The SMTChecker has also been updated to fully support the new property.<\/p>\n<h4>Removals and Deprecations<\/h4>\n<p>As part of ongoing efforts to maintain a lean and sustainable codebase, version v0.8.37 removes two experimental features introduced in v0.8.35: the Language Server Protocol mode (<code>--lsp<\/code>) and the Generic Solidity prototype (<code>pragma experimental solidity<\/code>). Language server tooling is now encouraged to evolve independently from the core compiler, while experimentation with core language architecture has shifted to the standalone <code>solcore<\/code> repository.<\/p>\n<p>Additionally, the experimental <code>ABIEncoderV2<\/code> pragma now emits a deprecation warning, paving the way for its eventual complete removal since ABI coder v2 became standard in v0.8.0. Deprecation warnings have also been extended to older EVM versions\u2014specifically <code>constantinople<\/code>, <code>petersburg<\/code>, <code>istanbul<\/code>, and <code>berlin<\/code>\u2014as well as the SMTChecker&#8217;s BMC engine, continuing a deprecation roadmap initiated in earlier releases.<\/p>\n<h3>How to Install and Upgrade<\/h3>\n<p>Developers looking to upgrade to Solidity v0.8.37 can find complete installation instructions within the official documentation. Binary packages and release notes are available directly through the project&#8217;s GitHub repository under tag v0.8.37. When building from source, developers are advised to utilize the official source tarball rather than automated GitHub source archives to ensure build integrity.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Solidity development team has officially announced the release of Solidity v0.8.37, bringing a series&#8230;<\/p>\n","protected":false},"author":12,"featured_media":3636,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[366],"tags":[988,401,2997,2183,2001,5,400,402,2131,638],"class_list":["post-3637","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-smart-contract-auditing","tag-amsterdam","tag-auditing","tag-bugfixes","tag-experimental","tag-released","tag-security","tag-smart-contracts","tag-solidity","tag-support","tag-updates"],"_links":{"self":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/posts\/3637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3637"}],"version-history":[{"count":0,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/posts\/3637\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/media\/3636"}],"wp:attachment":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}