Path-sensitive code embedding via contrastive learning for software vulnerability detection
Xiao Cheng, Guanqin Zhang, Haoyu Wang, Yulei Sui
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 13 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Combining Structured Static Code Information and Dynamic Symbolic Traces for Software Vulnerability Prediction 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- Combining Structured Static Code Information and Dynamic Symbolic Traces for Software Vulnerability Prediction 引用了 SimCSE: Simple Contrastive Learning of Sentence Embeddings
- Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection Systems 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection Systems 引用了 Vulnerability detection with fine-grained interpretations
- Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanation 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanation 引用了 Vulnerability detection with fine-grained interpretations
- Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanation 引用了 SimCSE: Simple Contrastive Learning of Sentence Embeddings
- SimCSE: Simple Contrastive Learning of Sentence Embeddings 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- When Less is Enough: Positive and Unlabeled Learning Model for Vulnerability Detection 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- When Less is Enough: Positive and Unlabeled Learning Model for Vulnerability Detection 引用了 Vulnerability detection with fine-grained interpretations
- Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detection 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detection 引用了 Vulnerability detection with fine-grained interpretations
- Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detection 引用了 A Security Analysis of Honeywords
引用它的顶会 Paper13
- Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability DetectionBenjamin Steenhoek, Hongyang Gao, Wei LeICSE 2024 · 54 次引用
- Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and ExplanationChao Ni, Xin Yin, Kaiwen Yang, Dehai Zhao 等FSE 2023 · 42 次引用
- Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection SystemsSicong Cao, Xiaobing Sun, Xiaoxue Wu, David Lo 等ICSE 2024 · 27 次引用
- When Less is Enough: Positive and Unlabeled Learning Model for Vulnerability DetectionXin-Cheng Wen, Xinchen Wang, Cuiyun Gao, Shaohua Wang 等ASE 2023 · 20 次引用
- Combining Structured Static Code Information and Dynamic Symbolic Traces for Software Vulnerability PredictionHuanting Wang, Zhanyong Tang, Shin Hwei Tan, Jie Wang 等ICSE 2024 · 15 次引用
它引用的 Paper13
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 次引用
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
- SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 次引用
- A Security Analysis of HoneywordsDing Wang, Haibo Cheng, Ping Wang, Jeff Yan 等NDSS 2018 · 1,102 次引用
- Vulnerability detection with fine-grained interpretationsYi Li, Shaohua Wang, Tien N. NguyenFSE 2021 · 283 次引用
相关 Paper
- CLeVeR: Multi-modal Contrastive Learning for Vulnerability Code RepresentationJiayuan Li, Lei Cui, Sen Zhao, Yun Yang 等ACL Findings 2025 · 4 次引用
- MVD: Memory-Related Vulnerability Detection Based on Flow-Sensitive Graph Neural NetworksSicong Cao, Xiaobing Sun, Lili Bo, Rongxin Wu 等ICSE 2022 · 100 次引用
- DeepVD: Toward Class-Separation Features for Neural Network Vulnerability DetectionWenbo Wang, Tien N. Nguyen, Shaohua Wang, Yi Li 等ICSE 2023 · 32 次引用
- Improving Smart Contract Security with Contrastive Learning-based Vulnerability DetectionYizhou Chen, Zeyu Sun, Zhihao Gong, Dan HaoICSE 2024 · 44 次引用
- Code Vulnerability Detection via Nearest Neighbor MechanismQianjin Du, Xiaohui Kuang, Gang ZhaoEMNLP Findings 2022 · 6 次引用
