Lune

ISSTA2022Top-tier venue

Path-sensitive code embedding via contrastive learning for software vulnerability detection

Xiao Cheng, Guanqin Zhang, Haoyu Wang, Yulei Sui

Abstract

Machine learning and its promising branch deep learning have shown success in a wide range of application domains. Recently, much effort has been expended on applying deep learning techniques (e.g., graph neural networks) to static vulnerability detection as an alternative to conventional bug detection methods. To obtain the structural information of code, current learning approaches typically abstract a program in the form of graphs (e.g., data-flow graphs, abstract syntax trees), and then train an underlying classification model based on the (sub)graphs of safe and vulnerable code fragments for vulnerability prediction. However, these models are still insufficient for precise bug detection, because the objective of these models is to produce classification results rather than comprehending the semantics of vulnerabilities, e.g., pinpoint bug triggering paths, which are essential for static bug detection. This paper presents ContraFlow, a selective yet precise contrastive value-flow embedding approach to statically detect software vulnerabilities. The novelty of ContraFlow lies in selecting and preserving feasible value-flow (aka program dependence) paths through a pretrained path embedding model using self-supervised contrastive learning, thus significantly reducing the amount of labeled data required for training expensive downstream models for path-based vulnerability detection. We evaluated ContraFlow using 288 real-world projects by comparing eight recent learningbased approaches. ContraFlow outperforms these eight baselines by up to 334.1%, 317.9%, 58.3% for informedness, markedness and F1 Score, and ContraFlow achieves up to 450.0%, 192.3%, 450.0% improvement for mean statement recall, mean statement precision and mean IoU respectively in terms of locating buggy statements.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

13 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Combining Structured Static Code Information and Dynamic Symbolic Traces for Software Vulnerability Prediction cites A Simple Framework for Contrastive Learning of Visual Representations
  • Combining Structured Static Code Information and Dynamic Symbolic Traces for Software Vulnerability Prediction cites SimCSE: Simple Contrastive Learning of Sentence Embeddings
  • Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection Systems cites A Simple Framework for Contrastive Learning of Visual Representations
  • Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection Systems cites Vulnerability detection with fine-grained interpretations
  • Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanation cites A Simple Framework for Contrastive Learning of Visual Representations
  • Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanation cites Vulnerability detection with fine-grained interpretations
  • Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanation cites SimCSE: Simple Contrastive Learning of Sentence Embeddings
  • SimCSE: Simple Contrastive Learning of Sentence Embeddings cites A Simple Framework for Contrastive Learning of Visual Representations
  • When Less is Enough: Positive and Unlabeled Learning Model for Vulnerability Detection cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • When Less is Enough: Positive and Unlabeled Learning Model for Vulnerability Detection cites Vulnerability detection with fine-grained interpretations
  • Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detection cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detection cites Vulnerability detection with fine-grained interpretations
  • Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detection cites A Security Analysis of Honeywords
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers13

  1. Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability DetectionBenjamin Steenhoek, Hongyang Gao, Wei LeICSE 2024 · 54 citations
  2. Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and ExplanationChao Ni, Xin Yin, Kaiwen Yang, Dehai Zhao et al.FSE 2023 · 42 citations
  3. Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection SystemsSicong Cao, Xiaobing Sun, Xiaoxue Wu, David Lo et al.ICSE 2024 · 27 citations
  4. When Less is Enough: Positive and Unlabeled Learning Model for Vulnerability DetectionXin-Cheng Wen, Xinchen Wang, Cuiyun Gao, Shaohua Wang et al.ASE 2023 · 20 citations
  5. Combining Structured Static Code Information and Dynamic Symbolic Traces for Software Vulnerability PredictionHuanting Wang, Zhanyong Tang, Shin Hwei Tan, Jie Wang et al.ICSE 2024 · 15 citations

Builds on13

  1. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
  2. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  3. SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 citations
  4. A Security Analysis of HoneywordsDing Wang, Haibo Cheng, Ping Wang, Jeff Yan et al.NDSS 2018 · 1,102 citations
  5. Vulnerability detection with fine-grained interpretationsYi Li, Shaohua Wang, Tien N. NguyenFSE 2021 · 283 citations

Related papers

  1. CLeVeR: Multi-modal Contrastive Learning for Vulnerability Code RepresentationJiayuan Li, Lei Cui, Sen Zhao, Yun Yang et al.ACL Findings 2025 · 4 citations
  2. MVD: Memory-Related Vulnerability Detection Based on Flow-Sensitive Graph Neural NetworksSicong Cao, Xiaobing Sun, Lili Bo, Rongxin Wu et al.ICSE 2022 · 100 citations
  3. DeepVD: Toward Class-Separation Features for Neural Network Vulnerability DetectionWenbo Wang, Tien N. Nguyen, Shaohua Wang, Yi Li et al.ICSE 2023 · 32 citations
  4. Improving Smart Contract Security with Contrastive Learning-based Vulnerability DetectionYizhou Chen, Zeyu Sun, Zhihao Gong, Dan HaoICSE 2024 · 44 citations
  5. Code Vulnerability Detection via Nearest Neighbor MechanismQianjin Du, Xiaohui Kuang, Gang ZhaoEMNLP Findings 2022 · 6 citations
Dusk over the sea between two cliffs drawn in fine vertical lines