Research map / Time series / Foundation models for time series
CLEP: A Novel Contrastive Learning Method for Evolutionary Reentrancy Vulnerability Detection
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes CLEP, a cross-version contrastive learning method with evolving (class and version) pairs and a version-aware sampler (MPVSampler) to detect evolutionary reentrancy vulnerabilities in Solidity smart contracts across versions.
Problem
Detecting reentrancy vulnerabilities in smart contracts whose patterns and semantics evolve across Solidity versions, causing existing detectors to degrade on newer versions and drift away from learned distributions.
Approach
Uses version labels alongside class labels to form hierarchical positive/negative contract pairs (same-version vulnerable, cross-version or flawless, vulnerable vs flawless) in a cross-version contrastive loss, plus a version-aware sampler that ensures every batch covers all versions, and then fine-tunes with few new-version samples.
Key results
- Version-specific fine-tuning: CLEP achieves 95.21% F1 on <0.5 versus 92.10% for Peculiar and 93.01% for ReVulDL (VSFT).
- Cross-version fine-tuning: CLEP reaches 84.96% F1, improving over Peculiar and ReVulDL by 14.20% and 12.84%.
- Sequential fine-tuning on unseen version 0.8: CLEP achieves 76.80% F1, 17.85% and 16.46% above Peculiar and ReVulDL.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| use CLEP instead of ReVulDL with version-specific fine-tuning | Reentrancy detection · SmartBug Wild (<0.5) | F1: 92.10 -> 95.21 | Helped |
| use CLEP instead of ReVulDL with version-specific fine-tuning | Reentrancy detection · ReTranStudy (0.5) | F1 | Helped |
| use CLEP instead of ReVulDL with version-specific fine-tuning | Reentrancy detection · ReTranStudy (0.6) | F1 | Helped |
| use CLEP instead of ReVulDL with version-specific fine-tuning | Reentrancy detection · ReTranStudy (0.7) | F1 | Helped |
| use CLEP instead of ReVulDL with version-specific fine-tuning | Reentrancy detection · ReTranStudy (0.8) | F1: 66.54 -> 77.30 | Helped |
| use CLEP with cross-version fine-tuning instead of ReVulDL | Reentrancy detection · All versions (<0.5 to 0.8) | F1: 14.20% | Helped |
| use CLEP with sequential fine-tuning instead of ReVulDL | Reentrancy detection · ReTranStudy (0.8) unseen test data | F1: 16.46% | Helped |
| add cross-version contrastive loss instead of using SupCon (ablation) | CLEP · All versions | F1: 2.45% | Helped |
| add MPVSampler instead of MPerClassSampler (ablation) | CLEP with SupCon · All versions | F1: 4.68% | Helped |
| add both MPVSampler and cross-version contrastive loss (ablation) | CLEP · All versions | F1: 7.13% | Helped |
| use Euclidean distance instead of cosine distance (ablation) | CLEP · All versions | F1: 3.67% | Helped |
Surprising findings
- A well-trained detector's precision drops from 0.92 to 0.65 when tested on newer contract versions, showing evolution-driven degradation.
Limitations
- Supervised approach that requires annotated multi-version data; focused only on reentrancy vulnerabilities.
- Performance still drops on newer versions (e.g., 20.21% drop from <0.5 to 0.8 under VSFT).
Experimental setup
Datasets: SmartBug Wild ReTranStudy
Benchmarks: SmartBug Wild ReTranStudy
Metrics: recall precision F1 ROC AUC
Baselines: Oyente Mythril Securify Slither Smartian Sailfish Vanilla-RNN LSTM GRU Peculiar ReVulDL
Builds on: GraphCodeBERT supervised contrastive loss (SupCon) Peculiar ReVulDL
Closest papers by meaning
- MTVHunter: Smart Contracts Vulnerability Detection Based on Multi-Teacher Knowledge Translation (AAAI 2025 · similarity 0.85)
- EVMbench: Evaluating AI Agents on Smart Contract Security (ICML 2026 · similarity 0.83)
- Detecting Bugs with Substantial Monetary Consequences by LLM and Rule-based Reasoning (NeurIPS 2024 · similarity 0.83)
- Protecting Model Adaptation from Trojans in the Unlabeled Data (AAAI 2025 · similarity 0.82)
- MetaCipher: A Time-Persistent and Universal Multi-Agent Framework for Cipher-Based Jailbreak Attacks for LLMs (AAAI 2026 · similarity 0.81)
- Efficient Availability Attacks against Supervised and Contrastive Learning Simultaneously (NeurIPS 2024 · similarity 0.81)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
