Summary
Cross-chain bridges that connect different blockchains sometimes lose assets due to hidden software bugs. This paper studies how large language models (LLMs) can find these bugs by analyzing the program’s source code or transaction data on Solana, a blockchain platform. The authors created different versions of a bridge with known bugs and safe versions to test the models. They found that LLMs do better at spotting bugs when source code comments explain the problem, and that diagnosing transactions is very effective for some bug types but poor overall. This work shows that careful use of LLMs could improve bridge security by distinguishing real bugs from false alarms.
What this means in practice
- •For blockchain security teams: Use LLMs to review Solana bridge code and identify vulnerabilities when detailed comments are present.
- •For smart contract developers: Employ LLMs on transaction logs to detect specific signing-related attacks against deployed Solana programs.
Authors
Yasir Rahman, Ishraq Samiha, Shahnewaz Karim Sakib, Anindya Bijoy Das
Abstract
Cross-chain bridges have suffered substantial asset losses due to vulnerabilities in their on-chain programs. On Solana, missing validation checks can enable exploits even when the underlying blockchain operates correctly. The ability of large language models (LLMs) to diagnose these flaws from source code or transaction records, rather than merely raise alarms, remains insufficiently understood. We implement a native Rust lock-and-mint bridge on a local Solana validator with four exploitable variants: two model flaws from the Cashio and Wormhole incidents, while the other two represent vulnerability classes documented in Solana security audits. Paired vulnerable and secure programs, together with successful attacks, benign sessions, and blocked attempts, allow us to distinguish correct diagnoses from unsupported alarms. We evaluate six configurations of five open-weight models across 16,800 responses, compare source inputs with and without comments, and grade 7,200 answers on vulnerable inputs using two blinded LLM graders. The results reveal substantial differences across conditions: without comments, models diagnose 24% of vulnerable source inputs while frequently flagging the secure bridge. Transaction diagnosis is high for the missing-signer scenario but averages 6% across the other three scenarios. Original comments, some of which describe the flaw, increase source diagnosis to 60%. These findings highlight the importance of distinguishing correct vulnerability diagnoses from unsupported alarms in bridge security review.