On June 8, 2026, a developer known as clonker from the core Solidity team identified a significant bug residing within the analysis phase of the Solidity compiler. The flaw, which has been assigned a medium severity rating on the team’s internal scale, specifically manifests under specialized conditions involving custom storage layouts and contract inheritance. Although the potential impact of a triggered bug is high—potentially causing silent miscompilations or internal compiler errors—extensive scans and database queries suggest that the real-world vulnerability surface is extremely narrow. The development team has swiftly addressed the issue, releasing Solidity version 0.8.36 to permanently resolve the underlying logic error.
The bug is tied directly to Warning 3495, an alert introduced by the compiler to warn developers when a custom storage layout is placed too close to the absolute end of the available storage space. Solidity allows developers to target custom base slots for their state variables using specific layout clauses. However, when the static portion of such a layout approaches the final boundary of the massive two-to-the-two-hundred-and-fiftieth-power slot storage space, the compiler emits a warning. This safeguard is designed to prevent developers from boxing themselves into a corner regarding future smart contract upgradability, where subsequent modifications might cause the storage layout to overflow the remaining slots.
The technical trigger for the warning involves calculating whether the number of free slots remaining after a given layout falls below two to the sixty-fourth power. Because hash-based expressions like the widely used ERC-7201 namespacing pattern generate pseudo-random slots, triggering this threshold unintentionally carries a vanishingly low probability, comparable to landing a specific mapping element on an exact pre-determined slot. Nevertheless, for contracts that do trigger Warning 3495, the internal mechanism devised to issue the alert inadvertently introduced a severe side effect across the compilation pipeline.
The root cause of the bug lies within a faulty helper function utilized during the warning’s generation. To identify which state variable sits closest to the storage boundary, the compiler routine inspects the list of base contracts associated with the contract being checked, which is stored in the linearizedBaseContracts AST annotation. This annotation encodes the fundamental C3 linearization of the inheritance hierarchy—a deterministic ordering mechanism that drives critical inheritance-dependent decisions throughout the entire compilation process.
Instead of generating a safe, non-destructive copy of the list before processing, the warning implementation performed a reversal directly in place on the underlying container. This unintended mutation permanently altered the structural data viewed by the rest of the compiler.
The implementation flaw stemmed from the misuse of a specific tool from the open-source range-v3 C++ library. Developers utilized actions::reverse instead of the intended views::reverse helper. While views::reverse merely produces a read-only, reversed view of a container for iteration purposes, the actions variant mutates the underlying collection directly. Because both library helpers share virtually identical signatures, the mistake slipped past standard checks.
Compounding this issue was the design of the compiler’s annotation system itself, where annotations are traditionally maintained as mutable structures to optimize performance, violating strict const-correctness principles. Consequently, the C++ compiler failed to flag the usage of actions::reverse as an invalid operation. Because this helper was exclusively invoked during the generation of the storage-end warning, the data corruption only occurred in codebases that successfully triggered the warning criteria.
The ramifications for the remainder of the compiler when this corruption occurs are profound. Because the linearizedBaseContracts annotation dictates inheritance resolution across both analysis and code generation phases, reversing the order breaks numerous fundamental language guarantees. Confirmed secondary effects of this corruption include the inversion of state-variable initialization sequences, incorrect constructor invocation orders, faulty resolution of virtual functions and the super keyword, broken virtual modifier resolutions, and scrambled virtual fallback and receive function resolutions. Furthermore, this inverted hierarchy is directly mirrored in the AST JSON export output. Depending on the complexity of the affected contract, these errors manifest either as silent miscompilations or as hard crashes resulting in internal compiler errors and invalid intermediate representation during the build process.
The bug exists independently of the chosen compilation pipeline. Because the flaw resides in the language frontend’s static analysis phase, both the legacy evmasm pipeline and the modern IR-based pipeline are equally affected. Pure Yul code remains completely untouched by the bug, and transient storage variables are immune since custom storage layouts are restricted strictly to persistent storage. The vulnerable code was originally shipped in Solidity 0.8.29—the exact release that introduced the storage-end warning—meaning that every compiler version from 0.8.29 through 0.8.35 contains the flaw.
An evaluation of real-world codebases indicates that actual exploitation or accidental triggering of this bug in production environments is exceedingly rare. An exhaustive search of public GitHub configurations for projects suppressing Warning 3495 returned zero results, indicating that intentionally anchoring storage variables near the absolute upper limits of the address space is not standard practice among developers. This finding was further corroborated by an independent scan conducted via Sourcify across verified smart contracts, which yielded no instances of affected contracts meeting all necessary conditions in the wild.
To be impacted by the bug, a smart contract must fulfill a specific combination of criteria. It must utilize a vulnerable compiler version between 0.8.29 and 0.8.35, employ a custom storage layout clause positioned within the final two to the sixty-fourth power slots of storage to trigger Warning 3495, and utilize a multi-contract inheritance hierarchy where the ordering of base contracts materially affects initialization or execution flow. Contracts that lack inheritance or bypass custom storage layouts are entirely unaffected, regardless of the compiler version used.
The Solidity team has formally addressed and eliminated the vulnerability in Solidity version 0.8.36. The code fix replaces the destructive ranges::actions::reverse helper with the safe ranges::views::reverse implementation, ensuring that internal AST annotations remain pristine during warning generation. Developers currently utilizing any version from 0.8.29 through 0.8.35 are strongly encouraged to upgrade their toolchains to version 0.8.36 immediately to ensure compiler integrity, particularly if their projects make use of advanced inheritance patterns alongside custom storage configurations. The discovery and subsequent patching of the issue were conducted entirely by the internal Solidity engineering team.

