Neural Transfer Learning for Repairing Security Vulnerabilities in C Code
Top Cited Papers
Open Access
- 1 February 2022
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 49 (1) , 147-165
Abstract
In this paper, we address the problem of automatic repair of software vulnerabilities with deep learning. The major problem with data-driven vulnerability repair is that the few existing datasets of known confirmed vulnerabilities consist of only a few thousand examples. However, training a deep learning model often requires hundreds of thousands of examples. In this work, we leverage the intuition that the bug fixing task and the vulnerability fixing task are related and that the knowledge learned from bug fixes can be transferred to fixing vulnerabilities. In the machine learning community, this technique is called transfer learning. In this paper, we propose an approach for repairing security vulnerabilities named VRepair which is based on transfer learning. VRepair is first trained on a large bug fix corpus and is then tuned on a vulnerability fix dataset, which is an order of magnitude smaller. In our experiments, we show that a model trained only on a bug fix corpus can already fix some vulnerabilities. Then, we demonstrate that transfer learning improves the ability to repair vulnerable C functions. We also show that the transfer learning model performs better than a model trained with a denoising task and fine-tuned on the vulnerability fixing task. To sum up, this paper shows that transfer learning works well for repairing security vulnerabilities in C compared to learning on a small dataset.Keywords
All Related Versions
Funding Information
- Wallenberg Artificial Intelligence, Autonomous Systems and Software Program
- Knut och Alice Wallenbergs Stiftelse
- Swedish Foundation for Strategic Research
- National Science Foundation (CCF-1750399)
- Vetenskapsrådet (2018-05973)
This publication has 53 references indexed in Scilit:
- Safe Memory-Leak Fixing for C Programs2015
- Defects4J: a database of existing faults to enable controlled testing studies for Java programs2014
- Findings of the 2014 Workshop on Statistical Machine Translation2014
- On the Properties of Neural Machine Translation: Encoder–Decoder Approaches2014
- Diagnosis and Emergency Patch Generation for Integer Overflow ExploitsLecture Notes in Computer Science, 2014
- Software fault prediction metrics: A systematic literature reviewInformation and Software Technology, 2013
- Infer: An Automatic Program Verifier for Memory Safety of C Programs2011
- Transfer Learning2010
- Using mega-trend-diffusion and artificial samples in small data set learning for early flexible manufacturing system scheduling knowledgeComputers & Operations Research, 2007
- Early Stopping - But When?1998