arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.02771cs.CR
收藏

ContractShield:通过层次交叉模态融合弥合语义-结构差距以实现多标签漏洞检测

ContractShield: Bridging Semantic-Structural Gaps via Hierarchical Cross-Modal Fusion for Multi-Label Vulnerability Detection in Obfuscated Smart Contracts

University of Information Technology(信息技术大学);Vietnam National University Ho Chi Minh City(越南国家大学胡志明市分校);VNU-HCM Information Security Center(胡志明市越南国家大学信息安全中心);Singapore Institute of Technology(新加坡理工学院)

Minh-Dai Tran-Duong, Nguyen Hai Phong, Nguyen Chi Thanh, Doan Minh Trung, Tram Truong-Huu, Van-Hau Pham, Phan The Duy

AI总结:

ContractShield通过三级融合机制有效关联多互补特征,提升智能合约漏洞检测鲁棒性,实现89%的Hamming得分和五种主要漏洞类型的91%F1-score。

摘要:

智能合约正受到对手使用伪装代码注入和控制流操纵等技术进行攻击。现有多模态方法通常孤立处理语义、时间和结构特征,并使用简单的拼接策略融合,忽视了跨模态交互,削弱了鲁棒性,因为单一模态的混淆会显著降低检测准确性。为了解决这些挑战,我们提出了ContractShield,一个具有新颖融合机制的稳健多模态框架,通过三级融合有效关联多个互补特征。自注意力首先在每个特征空间内识别指示漏洞的模式。跨模态注意力随后在不同模态间建立有意义的连接。然后,自适应加权动态校准特征贡献,基于其在混淆下的可靠性。对于特征提取,ContractShield整合(1)CodeBERT与滑动窗口机制以捕捉源代码中的语义依赖,(2)扩展长短期记忆(xLSTM)以建模指令序列中的时间动态,以及(3)GATv2以识别在混淆下保持稳定的控制流图(CFG)中的结构不变量。实证评估证明了ContractShield的鲁棒性,仅在非混淆数据下降1-3个百分点的情况下实现了89%的Hamming得分。该框架同时检测五种主要漏洞类型,F1-score达到91%,在对抗条件下优于现有最先进方法6-15个百分点。

英文摘要:

Smart contracts are increasingly targeted by adversaries employing obfuscation techniques such as bogus code injection and control flow manipulation to evade vulnerability detection. Existing multimodal methods often process semantic, temporal, and structural features in isolation and fuse them using simple strategies such as concatenation, which neglects cross-modal interactions and weakens robustness, as obfuscation of a single modality can sharply degrade detection accuracy. To address these challenges, we propose ContractShield, a robust multimodal framework with a novel fusion mechanism that effectively correlates multiple complementary features through a three-level fusion. Self-attention first identifies patterns that indicate vulnerability within each feature space. Cross-modal attention then establishes meaningful connections between complementary signals across modalities. Then, adaptive weighting dynamically calibrates feature contributions based on their reliability under obfuscation. For feature extraction, ContractShield integrates (1) CodeBERT with a sliding window mechanism to capture semantic dependencies in source code, (2) Extended long short-term memory (xLSTM) to model temporal dynamics in opcode sequences, and (3) GATv2 to identify structural invariants in control flow graphs (CFGs) that remain stable across obfuscation. Empirical evaluation demonstrates resilience of ContractShield, achieving a 89 percentage Hamming Score with only a 1-3 percentage drop compared to non-obfuscated data. The framework simultaneously detects five major vulnerability types with 91 percentage F1-score, outperforming state-of-the-art approaches by 6-15 percentage under adversarial conditions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑