fix: upgrade solc 0.8.30 → 0.8.34 to mitigate TSTORE Poison compiler bug#14
Merged
Conversation
solc 0.8.28–0.8.33 with via-IR has a cache key collision in storageSetToZeroFunction: `delete` on a transient state variable can silently emit sstore instead of tstore (or vice versa), causing permanent storage corruption (e.g. zeroing owner slot, bypassing reentrancy guards, persisting stale approvals). This project meets 3 of 4 trigger conditions: - solc 0.8.30 ✓ - viaIR = true ✓ - `bool transient _locked` in 5 contracts ✓ - `delete` on transient vars ✗ (only assignment used — safe for now) While not currently exploitable (no `delete` on transient vars), upgrading to 0.8.34 eliminates the risk entirely and prevents future code changes from accidentally activating the bug. References: - https://hexens.io/research/solidity-compiler-bug-tstore-poison - https://soliditylang.org/blog/2026/02/18/transient-storage-clearing-helper-collision-bug/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
solc 0.8.28–0.8.33 with via-IR has a cache key collision in storageSetToZeroFunction:
deleteon a transient state variable can silently emit sstore instead of tstore (or vice versa), causing permanent storage corruption (e.g. zeroing owner slot, bypassing reentrancy guards, persisting stale approvals).This project meets 3 of 4 trigger conditions:
bool transient _lockedin 5 contracts ✓deleteon transient vars ✗ (only assignment used — safe for now)While not currently exploitable (no
deleteon transient vars), upgrading to 0.8.34 eliminates the risk entirely and prevents future code changes from accidentally activating the bug.References: