{"id":5156,"date":"2026-12-05T15:15:12","date_gmt":"2026-12-05T15:15:12","guid":{"rendered":"https:\/\/smartcryptosecurity.com\/?p=5156"},"modified":"2026-12-05T15:15:12","modified_gmt":"2026-12-05T15:15:12","slug":"solidity-v0-8-39-released-critical-storage-bug-fix-experimental-amsterdam-evm-warnings-and-preparations-for-v0-9-0","status":"publish","type":"post","link":"https:\/\/smartcryptosecurity.com\/?p=5156","title":{"rendered":"Solidity v0.8.39 Released: Critical Storage Bug Fix, Experimental Amsterdam EVM Warnings, and Preparations for v0.9.0"},"content":{"rendered":"<p>The development team behind Solidity has officially announced the release of Solidity v0.8.39, marking what is expected to be the final milestone in the long-running 0.8 series before the transition to version 0.9.0. The latest compiler release addresses a medium-severity bug capable of silently corrupting storage data during specific recursive struct operations, alongside resolving a separate miscompilation issue tied to nested tuple assignments within the evmasm pipeline. Furthermore, v0.8.39 introduces updated code-size warning limits for the experimental Amsterdam EVM version and expands the integration of the ethdebug format for enhanced developer tooling.<\/p>\n<h2>Important Bugfixes<\/h2>\n<h3>Overlapping Recursive Storage Struct Copy Corruption<\/h3>\n<p>The most critical update in Solidity v0.8.39 involves a medium-severity bug that could result in silent storage corruption. The issue manifested when a recursive struct\u2014defined as a struct that can contain values of its own type, such as a typical node structure housing an array of child nodes and a numeric data identifier\u2014was copied within storage to a location containing it. <\/p>\n<p>Common triggers for this behavior included assignments where a root storage variable of a recursive struct type was reassigned to one of its own children, or where an array of such structs interacted similarly. Because the source of the copy could be reached through complex pathways like storage pointers, mapping keys, or array indices, the overlap was not always immediately transparent in the source code assignment. <\/p>\n<p>During the execution of these vulnerable copies, the compiler&#8217;s generated logic would overwrite the storage area holding the source before the copy procedure had finished reading it. As a consequence, nested elements within the source structure were lost, and members declared after the array defaulted back to zero without triggering any error or warning messages. <\/p>\n<p>The flaw affected both the legacy evmasm pipeline and the newer IR pipeline, remaining independent of optimizer settings and specific EVM versions. Specifically, the evmasm pipeline was vulnerable across versions 0.4.9 through 0.8.38, while the IR pipeline was impacted from version 0.8.13 through 0.8.38.<\/p>\n<p>To remediate the vulnerability, the development team introduced a runtime check applicable to every storage-to-storage copy operation involving a recursive struct or an array of such structs. While this ensures data integrity, it introduces additional gas costs even when the source and target locations do not overlap. Additionally, because the runtime check utilizes stack space while walking the target structure, copies into deeply nested targets can experience reduced maximum nesting depths before hitting stack limits and failing. For instance, in test cases compiled using the IR pipeline alongside the optimizer, the maximum supported nesting depth decreased from 252 levels down to 126 levels.<\/p>\n<p>Despite the broad version range affected, automated scans of verified contracts hosted on the Sourcify database revealed no currently deployed contracts that actively performed an affected copy. The underlying<\/p>\n<p>issue was responsibly discovered and reported by security researcher cyberthirst via the Ethereum Foundation\u2019s bug bounty program.<\/p>\n<h2>Other Miscompilations<\/h2>\n<h3>Swapped Values in Nested Tuple Assignments<\/h3>\n<p>Solidity v0.8.39 also resolves a distinct miscompilation issue confined to the evmasm pipeline, where tuple assignments could inadvertently assign values to the incorrect variables. This anomalous behavior was triggered when a nested tuple on the right-hand side of an assignment contained a string literal positioned alongside another value, and that literal was targeted at a variable of type <code>bytes32<\/code>, <code>bytes<\/code>, or <code>string<\/code>.<\/p>\n<p>For example, when assigning values to a <code>bytes32 z<\/code> variable and a <code>uint256 a<\/code> variable using a nested structure, the compiler could erroneously assign a numeric value meant for another variable directly to the string-holding variable, and vice versa, without reporting any compilation errors or warnings. <\/p>\n<p>The IR pipeline remains entirely unaffected by this bug, and optimizer configurations do not influence its occurrence. The core development team does not classify this miscompilation as a direct security vulnerability, noting that the required pattern is highly unusual and practically rare. Nested tuple assignments are predominantly utilized for capturing multi-value returns from function calls, and Solidity functions cannot natively return string literals. Furthermore, outside of specific edge cases, tuple nesting offers no programmatic advantage over flat tuple assignments or sequential assignments. Any resulting type mismatches or corrupted memory references would typically manifest as out-of-gas reverts during testing.<\/p>\n<h2>Notable Features and Changes<\/h2>\n<p>Beyond security patches and bug fixes, Solidity v0.8.39 introduces important updates regarding EVM compatibility and compilation warnings. When developers compile contracts using the <code>--evm-version amsterdam<\/code> flag, the compiler now issues active warnings when contract code exceeds 64 KiB or when initialization code (initcode) surpasses 128 KiB. <\/p>\n<p>These updated warning thresholds align with upcoming network upgrades. EIP-7954 proposes raising the historical EIP-170 code size limit from 24 KiB to 64 KiB, while EIP-3860 increases the initcode limit established under EIP-3860 from 48 KiB to 128 KiB. For all other EVM versions\u2014including Osaka, which remains the current default\u2014the compiler continues to enforce the legacy limits. Support for the Amsterdam EVM version itself remains classified as experimental.<\/p>\n<p>Additionally, the compiler now extends code size warnings to standalone Yul code compilations, bringing parity to the warnings previously restricted to native Solidity code files.<\/p>\n<h3>ethdebug Type and Layout Information (Experimental)<\/h3>\n<p>In an ongoing effort to improve developer tooling and debugging capabilities, Solidity v0.8.39 introduces experimental support for emitting the full <code>info\/resources<\/code> schema of the ethdebug format via the <code>--ethdebug-resources<\/code> compiler flag. This format provides debuggers with precise descriptions of complex data types and their underlying memory layouts. Emitting this layout data is also a vital prerequisite for routing debug information smoothly through Yul. Because ethdebug remains in an experimental state, its usage requires the explicit inclusion of the <code>--experimental<\/code> command-line switch.<\/p>\n<h2>Looking Ahead to Solidity 0.9.0<\/h2>\n<p>For several years, the Solidity roadmap designated version 0.9.0 as a massive breaking release centered around making the IR pipeline the default compilation path. Because of this long-term messaging, many developers anticipated that moving to version 0.9.0 would introduce widespread breaking changes across existing codebases.<\/p>\n<p>The core team has updated its release philosophy. While transitioning the IR pipeline to the default status alongside the new SSA CFG code generator remains a primary objective, developers have decided to decouple these architectural shifts from the specific 0.9.0 version number. Waiting for a single monolithic release was inadvertently delaying other incremental breaking changes that could be safely integrated sooner. <\/p>\n<p>Moving forward, the Solidity team intends to publish breaking releases more frequently while keeping individual updates smaller in scope. Consequently, version numbers alone will no longer signal the magnitude of breaking changes within a given release. Adopting a more frequent cadence for breaking changes also enables the project to systematically prune legacy features that were preserved throughout the extended 0.8 release cycle.<\/p>\n<p>Most of the changes already merged into the upcoming 0.9.0 development branch focus on removing features deprecated in earlier 0.8 versions. Notable removals include legacy ABI coder v1, virtual modifiers, the <code>ABIEncoderV2<\/code> pragma, the SMTChecker&#8217;s BMC engine, and support for EVM versions older than Constantinople. The team plans to release a public pre-release of version 0.9.0 prior to finalizing the production version.<\/p>\n<h2>How to Install and Upgrade<\/h2>\n<p>Developers seeking to upgrade to the latest compiler version can follow the comprehensive installation instructions provided in the official Solidity documentation. Pre-compiled binaries and release packages are accessible directly via the project&#8217;s GitHub repository under the v0.8.39 release tag.<\/p>\n<p>Teams opting to build the compiler directly from source code are advised to avoid utilizing the automatically generated source archives provided by GitHub. Instead, maintainers recommend downloading the official <code>solidity_0.8.39.tar.gz<\/code> source tarball or checking out the specific <code>v0.8.39<\/code> tag using Git to ensure build integrity.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The development team behind Solidity has officially announced the release of Solidity v0.8.39, marking what&#8230;<\/p>\n","protected":false},"author":25,"featured_media":5155,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[366],"tags":[988,401,201,2183,2054,2001,5,400,402,517,594],"class_list":["post-5156","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-smart-contract-auditing","tag-amsterdam","tag-auditing","tag-critical","tag-experimental","tag-preparations","tag-released","tag-security","tag-smart-contracts","tag-solidity","tag-storage","tag-warnings"],"_links":{"self":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/posts\/5156","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\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5156"}],"version-history":[{"count":0,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/posts\/5156\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/media\/5155"}],"wp:attachment":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}