Solidity compiler bug SOL-2026-8: Overlapping Recursive Storage Struct Copy Corruption
Overwriting a recursive struct in storage with a struct nested inside it could silently corrupt storage. Affects 0.4.9 ≤ solc < 0.8.39.
Vuln-watch · relayed from a public source; see Source & attribution below
Summary
Overwriting a recursive struct in storage with a struct nested inside it could silently corrupt storage.
Details
A recursive struct refers to its own type through a mapping or a dynamically-sized array. This bug affected the dynamically-sized array case. In storage, such a struct can contain other structs of the same type as elements of its array. When the target of a storage-to-storage copy contained the source, the copy silently produced incorrect values. A storage struct is copied member by member in declaration order, and a storage array element by element. Copying the array member resized the target's array and rewrote or cleared its data area, which destroyed the source before the copy had finished reading it. The elements nested in the source were therefore lost, and any source member read after the array copy came back zeroed. The position of the array member in the struct only determined which other members were copied before it and therefore survived. The affected operations were struct assignment and array assignment in which the target contained the source. Copies in the opposite direction, i.e., source containing the target, were not affected: they failed through unbounded recursion and still do. Both the evmasm and IR pipelines were affected, independently of optimizer settings.
Affected
- Solidity compiler (solc), 0.4.9 ≤ solc < 0.8.39
Severity
Medium (upstream rating: "medium").
Recommended actions
- Contracts compiled with an affected solc version: check whether the conditions apply to your code; recompile with solc 0.8.39+
- Auditors: add this bug to version-specific checklists
Source & attribution
This 0xCERT advisory summarises Solidity compiler bug SOL-2026-8 (OverlappingRecursiveStorageStructCopyCorruption) from the Solidity team's bug list: https://blog.soliditylang.org/2026/11/19/overlapping-recursive-storage-struct-copy-corruption-bug/.
References
OpenPGP-signed. The signed text of this advisory verifies against the 0xCERT key CCC7 D9EC 9415 723D.
Published 2026-11-19 · last updated 2026-11-19
curl -s https://www.0xcert.com/pgp.asc | gpg --import && curl -s https://www.0xcert.com/advisory/0xCERT-2026-0377/signed.txt | gpg --verify