BugMagnifier: TON Transaction Simulator for Revealing Smart Contract Vulnerabilities
Yury Yanovich, Victoria Kovalevskaya, Maksim Egorov, Elizaveta Smirnova, Matvey Mishuris, Yash Madhwal, Kirill Ziborov, Vladimir Gorgadze, Subodh Sharma
TL;DR
BugMagnifier tackles the problem of detecting race-condition vulnerabilities in TON smart contracts by enabling dynamic, permutation-based testing of interleaved message processing. It introduces a TON-complete transaction simulator layered on TON Sandbox, a message permutation engine, and a differential state analyzer to expose temporal dependencies across the five TVM phases. The approach presents a quantitative model of vulnerability manifestation based on message ratios and demonstrates reproducible test scenarios, shifting vulnerability discovery from manual analysis to automated evidence generation. This work provides a practical framework for safer TON smart contract development in asynchronous environments and lays groundwork for future integration with formal verification techniques.
Abstract
The Open Network (TON) blockchain employs an asynchronous execution model that introduces unique security challenges for smart contracts, particularly race conditions arising from unpredictable message processing order. While previous work established vulnerability patterns through static analysis of audit reports, dynamic detection of temporal dependencies through systematic testing remains an open problem. We present BugMagnifier, a transaction simulation framework that systematically reveals vulnerabilities in TON smart contracts through controlled message orchestration. Built atop TON Sandbox and integrated with the TON Virtual Machine (TVM), our tool combines precise message queue manipulation with differential state analysis and probabilistic permutation testing to detect asynchronous execution flaws. Experimental evaluation demonstrates BugMagnifier's effectiveness through extensive parametric studies on purpose-built vulnerable contracts, revealing message ratio-dependent detection complexity that aligns with theoretical predictions. This quantitative model enables predictive vulnerability assessment while shifting discovery from manual expert analysis to automated evidence generation. By providing reproducible test scenarios for temporal vulnerabilities, BugMagnifier addresses a critical gap in the TON security tooling, offering practical support for safer smart contract development in asynchronous blockchain environments.
