Skip to content

fix: upgrade solc 0.8.30 → 0.8.34 to mitigate TSTORE Poison compiler bug#14

Merged
kupermind merged 1 commit into
mainfrom
fix/tstore-poison-warning
Mar 23, 2026
Merged

fix: upgrade solc 0.8.30 → 0.8.34 to mitigate TSTORE Poison compiler bug#14
kupermind merged 1 commit into
mainfrom
fix/tstore-poison-warning

Conversation

@77ph

@77ph 77ph commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

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:

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>
@kupermind kupermind merged commit 3fdac27 into main Mar 23, 2026
1 check passed
@kupermind kupermind deleted the fix/tstore-poison-warning branch March 23, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants