CVE-2025-70956 Overview
A State Pollution vulnerability was discovered in the TON Virtual Machine (TVM) before v2025.04. The issue exists in the RUNVM instruction logic (VmState::run_child_vm), which is responsible for initializing child virtual machines. The operation moves critical resources (specifically libraries and log) from the parent state to a new child state in a non-atomic manner. If an Out-of-Gas (OOG) exception occurs after resources are moved but before the state transition is finalized, the parent VM retains a corrupted state where these resources are emptied or invalid. Because RUNVM supports gas isolation, the parent VM continues execution with this corrupted state, leading to unexpected behavior or denial of service within the contract's context.
Critical Impact
Non-atomic state transitions in the TVM RUNVM instruction allow Out-of-Gas exceptions to corrupt parent VM state, enabling denial of service attacks against TON smart contracts.
Affected Products
- TON Virtual Machine (TVM) versions prior to v2025.04
- TON Blockchain smart contracts utilizing RUNVM instruction
- Applications dependent on TVM for smart contract execution
Discovery Timeline
- 2026-02-13 - CVE-2025-70956 published to NVD
- 2026-02-18 - Last updated in NVD database
Technical Details for CVE-2025-70956
Vulnerability Analysis
This vulnerability falls under CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes), manifesting as a state pollution issue in the TON Virtual Machine. The core problem lies in the non-atomic nature of resource transfers during child VM initialization.
When the VmState::run_child_vm function executes, it moves critical resources including libraries and log objects from the parent VM state to a newly created child state. This transfer operation is not atomic, meaning it occurs in multiple discrete steps rather than as a single indivisible operation. The vulnerability is exposed when an Out-of-Gas exception interrupts this process mid-execution.
The attack exploits the gas isolation feature of the RUNVM instruction. Since child VMs operate with their own gas budgets, an attacker can craft malicious contract calls designed to exhaust gas at precisely the moment between resource transfer and state finalization. When this occurs, the parent VM's state remains corrupted with emptied or invalid resource references, yet continues executing subsequent operations.
Root Cause
The root cause is the lack of atomicity in the state transition mechanism within VmState::run_child_vm. The function moves resources from parent to child state without implementing proper rollback mechanisms or atomic transaction semantics. When an OOG exception occurs during this critical window, there is no recovery path to restore the parent VM's resources to their original valid state.
Attack Vector
The attack can be executed remotely over the network without requiring authentication or user interaction. An attacker can deploy a malicious smart contract or send crafted transactions that trigger the RUNVM instruction with carefully calculated gas limits. The attack proceeds as follows:
The attacker initiates a transaction that invokes RUNVM with a gas limit designed to exhaust precisely during the child VM initialization phase. When the libraries and log resources are transferred to the child state but before finalization completes, the OOG exception fires. The parent VM then continues with corrupted state, potentially causing denial of service for the targeted contract or unexpected execution behaviors that could disrupt blockchain operations.
Technical details and proof-of-concept code demonstrating this vulnerability are available in the GitHub Gist PoC.
Detection Methods for CVE-2025-70956
Indicators of Compromise
- Unusual patterns of Out-of-Gas exceptions occurring during RUNVM instruction execution
- Smart contract state inconsistencies where library or log resources appear empty or corrupted
- Repeated failed transactions targeting specific contracts with precise gas limit configurations
- Anomalous transaction patterns with gas limits calculated to trigger OOG during child VM initialization
Detection Strategies
- Monitor TVM execution logs for OOG exceptions occurring specifically within VmState::run_child_vm operations
- Implement transaction pattern analysis to detect gas limit manipulation attempts targeting RUNVM instructions
- Deploy smart contract monitoring to identify state corruption in library and log resources post-execution
- Analyze blockchain mempool for suspicious transactions with calculated gas limits near RUNVM operation thresholds
Monitoring Recommendations
- Enable detailed TVM execution tracing to capture resource state before and after RUNVM operations
- Configure alerts for repeated OOG exceptions from the same source address or targeting the same contract
- Monitor for sudden increases in failed transaction rates associated with child VM initialization
- Track state changes in critical smart contracts for unexpected resource invalidation patterns
How to Mitigate CVE-2025-70956
Immediate Actions Required
- Upgrade TON Virtual Machine to version v2025.04 or later immediately
- Review deployed smart contracts for heavy reliance on RUNVM instruction and assess exposure
- Implement additional gas buffer margins in contract calls utilizing child VM operations
- Consider temporary workarounds such as avoiding RUNVM in critical contract paths until patched
Patch Information
The TON Blockchain development team has addressed this vulnerability in version v2025.04. The fix implements atomic state transitions for the RUNVM instruction, ensuring that resource transfers between parent and child VMs complete fully or roll back entirely on failure.
The security patch is available through the GitHub Commit Update. Release notes acknowledging the security researchers who discovered this vulnerability can be found in the GitHub Release Notes.
Workarounds
- Implement defensive gas estimation in contract calls to ensure sufficient gas for complete RUNVM execution
- Add pre-execution validation checks in smart contracts to verify state integrity before critical operations
- Consider using alternative VM instruction patterns that avoid the vulnerable RUNVM code path where feasible
- Deploy monitoring solutions to detect and flag potential exploitation attempts in real-time
# Verify TON version and upgrade if necessary
ton-node --version
# Expected: v2025.04 or later
# Check for the security patch commit
git log --oneline | grep 1835d84602bbaaa1593270d7ab3bb0b499920416
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

