GNN-Based Transfer Learning and Tuning for Detecting Code Vulnerabilities across Different Programming Languages
Authors:
- 1 July 2024
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 596-607
Abstract
Machine learning has emerged as a promising method for detecting code vulnerabilities. In existing research, models trained on available samples are applied to predict potential vulnerabilities in new code within the same language. This approach may not be directly applicable when dealing with languages that have limited vulnerable samples available. This paper leverages transfer learning and k-shot tuning to address this issue, aiming to classify various Common Weakness Enumeration (CWE) categories in code written in a target language by utilizing a model trained on data from a different base language. We build upon a foundational model that enhances a state-of-the-art Graph Neural Network (GNN) framework designed for code vulnerability detection. Our experiments using extensive datasets of 42 common CWEs in C, Java, and C# have yielded valuable findings. Specifically, when models trained in one language are transferred to another, there is a noticeable improvement in detection performance. The magnitude of performance enhancements varies across different CWEs. k-shot tuning further refines the transferred models. However, the extent of performance gains gradually diminishes as the value of k increases. Once k exceeds a certain threshold, the transferred knowledge may be overwritten. Furthermore, our research unveiled an asymmetry in the two transfer learning directions within each language pair, even when the languages share the same programming paradigm. Transferred models in both directions often exhibit differing performance levels across the majority of CWEs.Keywords
This publication has 15 references indexed in Scilit:
- GraphSPD: Graph-Based Security Patch Detection with Enriched Code Semantics2023
- A Hybrid Graph Neural Network Approach for Detecting PHP Vulnerabilities2022
- VELVET: a noVel Ensemble Learning approach to automatically locate VulnErable sTatements2022
- Neural Transfer Learning for Repairing Security Vulnerabilities in C CodeIEEE Transactions on Software Engineering, 2022
- Detecting Integer Overflow Errors in Java Source Code via Machine Learning2021
- Combining Graph Neural Networks with Expert Knowledge for Smart Contract Vulnerability DetectionIEEE Transactions on Knowledge and Data Engineering, 2021
- Deep Learning Based Vulnerability Detection: Are We There Yet?IEEE Transactions on Software Engineering, 2021
- Security Vulnerability Detection Using Deep Learning Natural Language Processing2021
- Combining Graph-Based Learning With Automated Data Collection for Code Vulnerability DetectionIEEE Transactions on Information Forensics and Security, 2020
- μVulDeePecker: A Deep Learning-Based System for Multiclass Vulnerability DetectionIEEE Transactions on Dependable and Secure Computing, 2019