Lune

ICSE2023Top-tier venue

Fine-grained Commit-level Vulnerability Type Prediction by CWE Tree Structure

Shengyi Pan, Lingfeng Bao, Xin Xia, David Lo, Shanping Li

Abstract

Identifying security patches via code commits to allow early warnings and timely fixes for Open Source Software (OSS) has received increasing attention. However, the existing detection methods can only identify the presence of a patch (i.e., a binary classification) but fail to pinpoint the vulnerability type. In this work, we take the first step to categorize the security patches into fine-grained vulnerability types. Specifically, we use the Common Weakness Enumeration (CWE) as the label and perform fine-grained classification using categories at the third level of the CWE tree. We first formulate the task as a Hierarchical Multi-label Classification (HMC) problem, i.e., inferring a path (a sequence of CWE nodes) from the root of the CWE tree to the node at the target depth. We then propose an approach named TREEVUL with a hierarchical and chained architecture, which manages to utilize the structure information of the CWE tree as prior knowledge of the classification task. We further propose a tree structure aware and beam search based inference algorithm for retrieving the optimal path with the highest merged probability. We collect a large security patch dataset from NVD, consisting of 6,541 commits from 1,560 GitHub OSS repositories. Experimental results show that TREE-VUL significantly outperforms the best performing baselines, with improvements of 5.9%, 25.0%, and 7.7% in terms of weighted F1-score, macro F1-score, and MCC, respectively. We further conduct a user study and a case study to verify the practical value of TREEVUL in enriching the binary patch detection results and improving the data quality of NVD, respectively.

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

  • Towards More Practical Automation of Vulnerability Assessment cites A Large-Scale Empirical Study of Security Patches
  • Towards More Practical Automation of Vulnerability Assessment cites DeepCVA: Automated Commit-level Vulnerability Assessment with Deep Multi-task Learning
  • Towards More Practical Automation of Vulnerability Assessment cites Finding A Needle in a Haystack: Automated Mining of Silent Vulnerability Fixes
  • Applying Contrastive Learning to Code Vulnerability Type Classification cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Applying Contrastive Learning to Code Vulnerability Type Classification cites The Devil is in the Tails: How Long-Tailed Code Distributions Impact Large Language Models
  • Neural SZZ Algorithm cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Neural SZZ Algorithm cites DeepCVA: Automated Commit-level Vulnerability Assessment with Deep Multi-task Learning
  • Neural SZZ Algorithm cites Finding A Needle in a Haystack: Automated Mining of Silent Vulnerability Fixes
  • The Devil is in the Tails: How Long-Tailed Code Distributions Impact Large Language Models cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • The Devil is in the Tails: How Long-Tailed Code Distributions Impact Large Language Models cites Finding A Needle in a Haystack: Automated Mining of Silent Vulnerability Fixes
  • Finding A Needle in a Haystack: Automated Mining of Silent Vulnerability Fixes cites A Large-Scale Empirical Study of Security Patches
  • Finding A Needle in a Haystack: Automated Mining of Silent Vulnerability Fixes cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers13

  1. The Devil is in the Tails: How Long-Tailed Code Distributions Impact Large Language ModelsXin Zhou, Kisub Kim, Bowen Xu, Jiakun Liu et al.ASE 2023 · 10 citations
  2. Neural SZZ AlgorithmLingxiao Tang, Lingfeng Bao, Xin Xia, Zhongdong HuangASE 2023 · 9 citations
  3. Identifying Affected Libraries and Their Ecosystems for Open Source Software VulnerabilitiesSusheng Wu, Wenyan Song, Kaifeng Huang, Bihuan Chen et al.ICSE 2024 · 9 citations
  4. Towards More Practical Automation of Vulnerability AssessmentShengyi Pan, Lingfeng Bao, Jiayuan Zhou, Xing Hu et al.ICSE 2024 · 8 citations
  5. Applying Contrastive Learning to Code Vulnerability Type ClassificationChen Ji, Su Yang, Hongyu Sun, Yuqing ZhangEMNLP 2024 · 6 citations

Builds on8

  1. 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
  2. A Large-Scale Empirical Study of Security PatchesFrank Li, Vern PaxsonCCS 2017 · 273 citations
  3. Detecting Missing-Check Bugs via Semantic- and Context-Aware Criticalness and Constraints InferencesKangjie Lu, Aditya Pakki, Qiushi WuUSENIX Security 2019 · 97 citations
  4. Finding A Needle in a Haystack: Automated Mining of Silent Vulnerability FixesJiayuan Zhou, Michael Pacheco, Zhiyuan Wan, Xin Xia et al.ASE 2021 · 84 citations
  5. DeepCVA: Automated Commit-level Vulnerability Assessment with Deep Multi-task LearningTriet Huynh Minh Le, David Hin, Roland Croft, Muhammad Ali BabarASE 2021 · 62 citations

Related papers

  1. Locating the Security Patches for Disclosed OSS Vulnerabilities with Vulnerability-Commit Correlation RankingXin Tan, Yuan Zhang, Chenyuan Mi, Jiajun Cao et al.CCS 2021 · 43 citations
  2. V1SCAN: Discovering 1-day Vulnerabilities in Reused C/C++ Open-source Software Components Using Code Classification TechniquesSeunghoon Woo, Eunjin Choi, Heejo Lee, Hakjoo OhUSENIX Security 2023
  3. Where is it? Tracing the Vulnerability-relevant Files from Vulnerability ReportsJiamou Sun, Jieshan Chen, Zhenchang Xing, Qinghua Lu et al.ICSE 2024 · 8 citations
  4. VulChecker: Graph-based Vulnerability Localization in Source CodeYisroel Mirsky, George Macon, Michael D. Brown, Carter Yagemann et al.USENIX Security 2023
  5. PatchFinder: A Two-Phase Approach to Security Patch Tracing for Disclosed Vulnerabilities in Open-Source SoftwareKaixuan Li, Jian Zhang, Sen Chen, Han Liu et al.ISSTA 2024 · 8 citations
Dusk over the sea between two cliffs drawn in fine vertical lines