The TON Smart Contract Exploit Registry is a durable, source-aware record of critical vulnerabilities and exploits specific to the TON Virtual Machine (TVM) and its actor-based execution model. Unlike EVM chains where atomic transactions are the norm, TON's architecture relies on asynchronous message passing between smart contracts, creating a distinct class of attack vectors. This registry catalogs real-world incidents involving FunC and Tact code, focusing on replay attacks on internal messages, race conditions in non-atomic cross-contract calls, and DeFi logic bugs that have led to the loss of user funds or protocol insolvency.

Smart Contract Exploit Registry
Introduction
A technical catalog of major exploits targeting TON's unique asynchronous smart contract patterns, detailing vulnerable code, exploit mechanics, and mitigation strategies for developers and auditors.
Each entry in this registry dissects the vulnerable code pattern, the precise exploit mechanics used by the attacker, and the resulting on-chain impact. The analysis extends beyond simple reentrancy to cover TON-specific pitfalls such as mishandling of bounce flags, incorrect parsing of message bodies in recv_internal, and state manipulation across shard boundaries. For developers and auditors, the registry serves as a practical adversarial knowledge base, translating post-mortem findings into concrete, actionable mitigation strategies—such as implementing strict message sender validation, using carry-value patterns correctly, and designing atomicity guards for multi-contract interactions.
For protocol architects, risk teams, and custodians, this registry provides the technical context needed to evaluate the security posture of TON-based DeFi protocols, wallets, and token contracts. Understanding these exploit patterns is essential for performing thorough integration risk assessments and for building monitoring systems that can detect anomalous asynchronous call flows. The registry connects each incident to broader operational implications, including the challenges of pausing or upgrading non-atomic contract systems during an active exploit.
Chainscore Labs supports teams in hardening their TON smart contracts against these documented exploit patterns through deep-dive code reviews, adversarial testing of asynchronous call graphs, and the design of incident response mechanisms tailored to TON's unique execution environment. If your team is building or integrating with TON DeFi protocols, our protocol impact assessments can help identify and remediate these risks before they lead to a critical incident.
Registry Quick Facts
A reference table of the primary exploit vectors for TON smart contracts, mapping each vulnerability class to its root cause, affected contract patterns, and the operational action required by developers and auditors.
| Exploit Class | Root Cause | Affected Pattern | Action |
|---|---|---|---|
Replay Attacks | Missing replay protection on internal messages | Wallet v3, Jetton wallets, payment channels | Audit message handler idempotency; implement seqno or hash-based checks |
Race Conditions | Non-atomic asynchronous cross-contract calls | DeFi lending, DEXs, multi-contract workflows | Review call chains for state manipulation windows; use carry-value patterns |
Reentrancy | Recursive message dispatch before state commit | Jetton transfer hooks, NFT ownership callbacks | Enforce checks-effects-interactions pattern; audit on-bounce and on-accept handlers |
Logic Bugs | Incorrect FunC/Tact arithmetic or access control | Staking contracts, governance, token vesting | Formally verify critical invariants; add fuzz testing for edge-case parameters |
Gas Exhaustion | Unbounded loops or excessive computation in get-methods | View functions, data serialization, iterators | Set hard iteration limits; test worst-case gas consumption on mainnet state |
Bounce Misdirection | Unhandled bounced messages returning value to attacker | Wallet-to-wallet transfers, escrow contracts | Validate sender on bounce handlers; never trust bounce message payloads |
Storage Fee Eviction | Contract frozen or deleted due to unpaid storage rent | Long-lived user wallets, data registries | Monitor contract balance vs. minimum storage threshold; implement auto-top-up or warn users |
Metadata Spoofing | Off-chain token metadata overriding on-chain identity | Jetton Minters, NFT Collections, explorers | Enforce on-chain metadata verification in wallets and dApps; use semi-chain content |
Technical Context: TON's Unique Attack Surface
The TON Virtual Machine's asynchronous, actor-based architecture creates a distinct class of smart contract vulnerabilities not found in synchronous EVM environments, requiring a fundamentally different approach to security analysis.
The TON blockchain executes smart contracts as independent actors that communicate exclusively through asynchronous message passing. Unlike Ethereum's atomic transaction model where a sequence of contract calls either fully succeeds or fully reverts, a TON transaction is a single message delivery that triggers a single contract execution. A user action that interacts with multiple contracts—such as a DeFi swap—is decomposed into a chain of separate, non-atomic messages. This means state changes across contracts are not guaranteed to be consistent, and an attacker can intentionally craft messages that arrive between these steps to observe and manipulate intermediate states. This fundamental architectural difference is the root cause of most TON-specific exploit patterns.
Key vulnerability classes emerge directly from this model. Reentrancy-by-message occurs when a contract sends a message to an untrusted contract and continues execution before the response arrives, allowing the callee to call back into the original contract in a subsequent transaction. Race conditions in asynchronous calls arise when a contract's state depends on the order of incoming messages from multiple sources, which an attacker can influence by carefully timing their own messages. Bounceable message handling flaws are unique to TON: if a message is sent with the bounce flag and the recipient rejects it, the sender receives a bounced message with the original value. Contracts that fail to correctly handle these bounce messages can be drained or left in an inconsistent state. The Smart Contract Exploit Registry catalogs real-world incidents where each of these patterns led to fund loss.
For developers and auditors, the operational implication is that standard EVM security checklists are insufficient. A TON contract must be verified to be secure under all possible message interleavings, not just within a single atomic execution context. This requires modeling the contract as a state machine and proving that no sequence of external messages can lead to an invariant violation. Chainscore Labs provides specialized review engagements for FunC and Tact contracts that apply this actor-model threat modeling, helping teams identify replayable message sequences, missing bounce handlers, and cross-contract state corruption risks before deployment.
Affected Actors
Immediate Code Review
Audit all contracts for the specific vulnerable pattern documented in the exploit entry. Pay special attention to asynchronous message handlers where state changes occur before external calls.
Mitigation Actions
- Implement reentrancy guards on all functions that send internal messages or call external contracts.
- For FunC, ensure state variables are updated before initiating cross-contract communication.
- For Tact, verify that
bouncehandlers cannot be exploited to replay failed messages. - Add explicit checks for message sender and value in all
receivehandlers.
Ongoing Prevention
Integrate the exploit pattern into your internal static analysis rules and fuzzing campaigns. Chainscore Labs can review your contract architecture to identify similar asynchronous call vulnerabilities before deployment.
Exploit Categories and Mitigation Patterns
A structured catalog of recurring exploit patterns in TON's asynchronous actor model, detailing the vulnerable code patterns, attack mechanics, and concrete mitigation strategies for FunC and Tact developers.
Asynchronous Call Race Conditions
Exploits arising from the non-atomic nature of cross-contract calls. Attackers manipulate shared state between the initial message send and the callback execution. Mitigation requires implementing a 'pending' state flag that locks critical functions until the asynchronous operation completes, preventing state corruption during the vulnerable window.
Internal Message Replay Attacks
Attackers capture and replay valid internal messages to drain contract balances or manipulate state. This is critical for wallet and high-value vault contracts. Mitigation patterns include enforcing a strictly incrementing sequence number per sender, using a hash-based nonce derived from the original transaction LT and hash, and invalidating the nonce immediately upon first processing.
Bounce Message Mishandling
Contracts that fail to correctly parse and handle bounced messages can have their state corrupted or funds locked. A common pattern is a contract sending funds without setting a bounce handler, or a handler that does not properly restore the contract's state to its pre-send condition. Developers must always implement a bounced function that explicitly reverts any optimistic state changes.
Gas Exhaustion and Griefing Vectors
Attackers craft transactions that force a contract to consume all allocated gas before completing a critical state change, leaving it in an undefined or locked state. This often targets unbounded loops or excessive data processing in a single transaction. Mitigation involves setting strict gas limits for external callers, using a pull-over-push payment pattern, and breaking complex logic into multiple chained transactions.
Unauthorized Message Sender Spoofing
Contracts that rely solely on the sender_address of an internal message without verifying the originating contract's code or a signed payload are vulnerable to spoofing. A malicious contract can craft a message that appears to be from a trusted source. The mitigation is to verify the sender's code hash against a known, immutable template or to require an off-chain signature verified within the contract.
Storage Fee Starvation and Contract Deactivation
A long-term exploit where an attacker prevents a contract from paying its storage fees, leading to its deletion by the network's garbage collector. This can be used to permanently freeze assets or break protocol dependencies. Mitigation patterns include implementing a self-funding mechanism for storage, a public 'top-up' function callable by any user, or a monitoring service that alerts operators when a contract's balance approaches the minimum threshold.
Risk Assessment Matrix
A structured breakdown of the primary exploit vectors, their failure modes, and the affected parties for TON smart contracts. Use this matrix to prioritize audit efforts and operational monitoring.
| Risk | Failure mode | Severity | Affected actors | Mitigation |
|---|---|---|---|---|
Asynchronous call race conditions | State manipulated between a contract's send and receive phases due to non-atomic execution | Critical | DeFi protocol architects, smart contract auditors, liquidity providers | Implement strict state-machine patterns; avoid reliance on external state after an async send |
Replay attacks on internal messages | A valid internal message is replayed by a malicious contract to drain funds or corrupt state | High | Wallet developers, token issuers, exchange integration teams | Use unique message identifiers and enforce strict replay protection via |
Reentrancy via bounced messages | A bounced message triggers a callback that re-enters the contract logic before state is fully updated | High | FunC/Tact developers, DeFi protocol teams, auditors | Apply the checks-effects-interactions pattern adapted for TON's bounce handlers; update state before processing bounce logic |
Oracle manipulation in DeFi | DEX-based TWAPs or external oracle data is manipulated to trigger unfair liquidations or bad debt | High | Lending protocol teams, derivatives platforms, risk managers | Use time-weighted average prices with outlier detection; integrate multiple oracle sources and circuit breakers |
Token metadata spoofing | Off-chain metadata is altered to impersonate a legitimate Jetton or NFT on explorers and wallets | Medium | Wallet UI teams, explorers, exchange listing teams | Verify token identity via on-chain root contract address; implement on-chain metadata verification standards |
Storage fee exhaustion | A smart contract or wallet becomes inaccessible because its TON balance is insufficient to pay rent for state storage | Medium | Long-term contract deployers, wallet users, infrastructure providers | Monitor contract balances and implement automated top-up services; design contracts with minimal on-chain state |
Governance parameter manipulation | A malicious proposal changes configurable network parameters to destabilize fees or validator elections | Critical | TON holders, governance delegates, validator operators | Implement timelocks on parameter changes; monitor governance proposals for extreme parameter shifts |
Lite Server data integrity failure | A compromised or faulty Lite Server serves incorrect chain data, leading to wrong balances or stale state | High | Wallet backends, dApp frontends, exchange deposit monitors | Query multiple Lite Servers and cross-verify responses; run a local Lite Client for critical operations |
Developer and Auditor Remediation Checklist
A structured checklist for development and security teams to systematically identify, remediate, and verify fixes for smart contract vulnerabilities after an incident. This process ensures that the root cause is addressed, similar attack vectors are eliminated across the codebase, and robust monitoring is in place to prevent recurrence.
What to check: Isolate the exact vulnerable code pattern in the exploited FunC or Tact contract. Replicate the exploit in a local sandbox or testnet environment using the original transaction payload and state conditions.
Why it matters: Without a deterministic reproduction, the fix is speculative. TON's asynchronous message-passing and phased execution model can mask the true sequence of events. A successful replication confirms the attack vector and provides a baseline for verifying the patch.
Readiness signal: A documented proof-of-concept script that successfully drains funds or corrupts state against a forked mainnet state, which then fails against the patched contract.
Canonical Resources
Primary references for maintaining a TON smart contract exploit registry, validating vulnerable FunC and Tact patterns, and converting incident findings into engineering controls.
Integration-Specific Runbooks
Exchanges, custodians, wallets, and DeFi protocols should maintain internal runbooks that translate registry findings into controls: paused deposits, stricter memo and message parsing, Jetton allowlists, bounce handling checks, sender authentication, replay protection, and abnormal outflow alerts. A useful exploit registry entry should identify which integration class is exposed and what evidence would trigger response. Chainscore Labs can help convert TON incident findings into review checklists, monitoring rules, and remediation plans.
Looking to build on a specific blockchain?
We build smart contracts, DeFi applications, wallets, tokenization platforms, and blockchain infrastructure across the major ecosystems teams choose today. That includes Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Solana, Sui, Aptos, Hedera, Stellar, and NEAR, with support for additional EVM and non-EVM networks based on your product requirements.
EVM ecosystems
- Ethereum
- Arbitrum
- Optimism
- Polygon
- Avalanche
- Cronos

Non-EVM ecosystems
- Solana
- Sui
- Aptos
- Hedera
- Stellar
- NEAR
Additional ecosystems
- Polkadot
- Cosmos
- TON
- Cardano
- Algorand
- Tempo
Also available for Base, appchains, custom EVM networks, and cross-chain product architecture.
Frequently Asked Questions
Common questions about the exploit patterns cataloged in this registry, their root causes, and the steps development and security teams should take to prevent similar vulnerabilities in their TON smart contracts.
TON's asynchronous, actor-based model means contracts communicate via internal messages that are not atomically executed. A common vulnerability arises when a contract sends an internal message and updates its state before the message is processed. If the receiving contract's execution fails and the message bounces back, the original contract's state has already advanced, and the attacker can replay the original message to drain funds or manipulate state again.
Why it matters: This breaks the atomicity assumption common in synchronous EVM environments. A single failed cross-contract call can create a replayable message that was only intended to be processed once.
What to check:
- Does the contract update its state before or after sending value-bearing internal messages?
- Is there a replay protection mechanism (e.g., a unique
query_idstored in a dictionary) that is checked and invalidated before any state change? - Are bounce handlers implemented to revert the state change if the outgoing message fails?
Delivering blockchain solutions for 5+ years.
We have partnered with 50+ leading DeFi protocols, NFT ecosystems, and fintech innovators to build secure, scalable, and capital-efficient blockchain products.
Selected Partners & Clients
“I've been working with Chainscore Labs for last 3+ years, they've consistently delivered with strong ownership across multiple projects. The team is reliable and detail-oriented.”
How to get started?
If you're looking for blockchain integration, ChainScore Labs has 5+ years of experience helping teams build and integrate exchanges, wallets, smart contracts, tokenization solutions, and protocol-connected products, we can help you choose the right path, integrate securely, and get to production faster. Our team consists of experienced blockchain developers and architects who can help you with your blockchain integration needs.
Exploration & Strategy
Define your product goals and choose the right blockchain architecture for your use case.
Architecture & Design
Design the smart contracts, tokenomics, and security parameters of your system.
Development & Integration
Build and integrate with wallets, oracles, and front-end dApps for a seamless experience.
Security & Launch
Comprehensive audits followed by a risk-managed mainnet deployment to protect your users.
Discover our
blockchain development services.
We build production-grade blockchain solutions for top-tier projects across DeFi and Web3.
Need a blockchain engineering team?
Send the project context and we will respond with next steps, scope questions, and a practical path to delivery.


