CLEP: A Novel Contrastive Learning Method for Evolutionary Reentrancy Vulnerability Detection

Authors

  • Jie Chen Southeast University
  • Liangmin Wang Southeast University
  • Huijuan Zhu Jiangsu University
  • Victor S. Sheng Texas Tech University

DOI:

https://doi.org/10.1609/aaai.v39i1.31981

Abstract

Reentrancy vulnerabilities in smart contracts have been exploited to steal enormous amounts of money, thus detecting reentrancy vulnerabilities is a hotspot issue in security research. However, a new attack is emerging in which attackers continuously release new reentrancy patterns to exploit fresh vulnerabilities and obfuscate existing ones. Existing detection methods neglect the time-series evolution of vulnerabilities across different smart contract versions, leading to a gradual decline in their effectiveness over time. We investigate the time-series correlations among vulnerabilities in various versions and refer to these as Evolutionary Reentrancy Vulnerabilities (ERVs). We summarize that ERVs detection faces two key challenges: (i) capturing the evolving pattern of ERVs along a complete evolutionary chain and (ii) detecting fresh reentrancy vulnerabilities in new versions. To address these challenges, we propose CLEP, a novel Contrastive Learning with Evolving Pairs detection method. It can effectively capture the evolving patterns by discerning similarities and differences across versions. Specifically, we first modified the sample distribution by incorporating version declarations as time-series evolution information. Then, leveraging the hierarchical similarity, we design an evolving pairs scheme to form negative and positive contract pairs across versions. Finally, we build a complete evolutionary chain by proposing a version-aware contrastive sampler. Our experimental results show that CLEP not only outperforms state-of-the-art baselines in version-specific scenarios but also shows promising performance in cross-version evolution scenarios.

Published

2025-04-11

How to Cite

Chen, J., Wang, L., Zhu, H., & Sheng, V. S. (2025). CLEP: A Novel Contrastive Learning Method for Evolutionary Reentrancy Vulnerability Detection. Proceedings of the AAAI Conference on Artificial Intelligence, 39(1), 67–74. https://doi.org/10.1609/aaai.v39i1.31981

Issue

Section

AAAI Technical Track on Application Domains