When Verified Source Becomes Attack Input: Defending Smart Contracts Against LLM-Based Vulnerability Scanning

2026-08-31

Authors: Mingyuan Huang, Zimo Ji, Yifan Mo, Shuai Wang

ArXiv: 2608.28400v1

PDF: Download PDF

Smart contracts — the little programs that run on blockchains like Ethereum and manage billions of dollars in digital assets — have a transparency tradition. To prove they're not doing anything sneaky, projects publish their source code on public block explorers and cryptographically verify that this source matches the compiled bytecode actually running on-chain. For years, this openness has been considered a security feature: anyone can audit the code before trusting it with their money.

This paper argues that openness has quietly become a liability. The reason is LLM agents. Attackers can now point a language-model-driven scanner at every verified contract on a blockchain and, in bulk, hunt for exploitable bugs at a scale no human auditor could match. The very thing that lets defenders inspect code also lets automated adversaries triage the entire ecosystem for prey.

The authors' response is clever, and a little counterintuitive: instead of hiding source code (which would break trust), they propose poisoning the source that gets published so that LLM scanners get confused, while human readers and the actual on-chain bytecode remain unaffected. Think of it as camouflage that only fools machines.

Concretely, they build a defense that:

The key insight is that LLMs and humans read code very differently. LLMs are pattern-matchers that get anchored on surface-level cues (function names, control-flow shapes, familiar idioms). Humans reason about intent and follow data flow. That gap creates room for defensive transformations that are adversarial to LLMs specifically — a new twist on the older idea of adversarial examples, but applied to code understanding instead of image classification.

The broader takeaway is a shift in how we should think about the smart contract disclosure model. When your adversary can afford to LLM-scan every contract ever deployed, "security through transparency" needs new machinery. The paper is an early attempt to give defenders a knob that doesn't require abandoning verifiability altogether.

Why it matters: As LLM-powered attackers automate vulnerability discovery at ecosystem scale, defenders need ways to preserve human auditability while degrading machine-driven exploitation — this paper offers a first concrete mechanism for exactly that tradeoff.

All newsletters