Developer reviewing smart contract architecture diagrams on a glass wall in a modern WeWork space, standing desk in background, natural industrial aesthetic, candid engineering moment.
Protocols

Smart Contract Exploit Registry

Technical catalog of major exploits targeting FunC and Tact smart contract patterns. Each entry details the vulnerable code pattern, exploit mechanics, and mitigation strategy for developers and auditors.
introduction
TON 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.

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.

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.

TON SMART CONTRACT EXPLOIT PATTERNS

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 ClassRoot CauseAffected PatternAction

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
ASYNCHRONOUS ACTOR MODEL AND MESSAGE-DRIVEN EXPLOITS

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.

EXPLOIT IMPACT ANALYSIS

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 bounce handlers cannot be exploited to replay failed messages.
  • Add explicit checks for message sender and value in all receive handlers.

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.

implementation-impact
TON SMART CONTRACT VULNERABILITY TAXONOMY

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.

01

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.

02

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.

03

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.

04

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.

05

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.

06

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.

SMART CONTRACT EXPLOIT REGISTRY

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.

RiskFailure modeSeverityAffected actorsMitigation

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 bounce flags and sequence checks

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

POST-EXPLOIT SECURITY HARDENING

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.

Chains We Build On

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 logo
    Ethereum
  • Arbitrum logo
    Arbitrum
  • Optimism logo
    Optimism
  • Polygon logo
    Polygon
  • Avalanche logo
    Avalanche
  • Cronos logo
    Cronos

Non-EVM ecosystems

  • Solana logo
    Solana
  • Sui logo
    Sui
  • Aptos logo
    Aptos
  • Hedera logo
    Hedera
  • Stellar logo
    Stellar
  • NEAR logo
    NEAR

Additional ecosystems

  • Polkadot logo
    Polkadot
  • Cosmos logo
    Cosmos
  • TON logo
    TON
  • Cardano logo
    Cardano
  • Algorand logo
    Algorand
  • Tempo logo
    Tempo

Also available for Base, appchains, custom EVM networks, and cross-chain product architecture.

EXPLOIT PATTERNS AND REMEDIATION

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_id stored 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?
Trusted by Industry Leaders

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

ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
“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.”
L
Lee Erswell
CEO, Telos Foundation
how to get started

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.

01

Exploration & Strategy

Define your product goals and choose the right blockchain architecture for your use case.

02

Architecture & Design

Design the smart contracts, tokenomics, and security parameters of your system.

03

Development & Integration

Build and integrate with wallets, oracles, and front-end dApps for a seamless experience.

04

Security & Launch

Comprehensive audits followed by a risk-managed mainnet deployment to protect your users.

Start a build

Need a blockchain engineering team?

Send the project context and we will respond with next steps, scope questions, and a practical path to delivery.