← Lab /Security & privacy

ContractShield detects vulnerabilities in obfuscated smart contracts with 89% Hamming Score

The authors claim their multimodal framework achieves high detection accuracy on obfuscated contracts.

Security & privacy arXiv 3 Apr 2026 Method Prototype evidence

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

Why it matters

ContractShield can be deployed as a core component of automated auditing pipelines or CI-integrated tooling to provide more reliable multi-label vulnerability detection even for obfuscated smart contracts.

Summary

ContractShield achieves 89% Hamming Score with only a 1-3% drop on obfuscated contracts and 91% F1-score, outperforming prior multimodal baselines by 6-15% under adversarial conditions. The paper reports robust performance across four real-world datasets and shows only modest degradation (as low as 1.22% HS loss) when faced with source-code and bytecode obfuscation. Evidence is based on experiments on ~18k contracts, but inference is slower than some single-modality models.

What they found 2

  1. High resilience to obfuscation with minimal performance loss

    “ContractShield’s resilience, achieving a 89% Hamming Score with only a 1-3% drop compared to non-obfuscated data.”

  2. Robustness quantified as HS decreasing only between 1.22% and 3.42% under various obfuscations

    “ContractShield, in particular, demonstrates consistently high robustness, with HS decreasing only between 1.22% and 3.42%, while still maintaining stable performance levels (HS of 85.74%-87.94% and F1-scores of 86.73%-87.94%).”

Caveats 6

  • Inference speed is slower than some baselines, taking 33.19 seconds per sample.
  • The reported HS degradation can reach up to 3.42%, slightly above the 1-3% range claimed in the abstract.
  • The internal validity of our experiments may be influenced by data quality and preprocessing.
  • Our study primarily focuses on Ethereum smart contracts written in Solidity.
  • The evaluation relies on standard metrics such as Hamming Score and F1-score, which may not fully capture the real-world security impact of classification errors.
  • The comparison among baseline models might be affected by differences in architectural complexity and computational requirements.

What’s new here 4

  • Introduces a hierarchical cross-modal fusion mechanism combining self-attention, cross-modal attention, and adaptive weighting.
  • Integrates three complementary modalities-sliding-window-enhanced CodeBERT for source code, xLSTM for opcode sequences, and GATv2 for CFGs.
  • Builds a comprehensive obfuscation benchmark suite (BiAn, BOSC, and combined) to evaluate robustness.
  • Demonstrates that multimodal fusion can maintain high detection accuracy with only 1-3% Hamming Score degradation under obfuscation.