arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2104.08308cs.SEcs.CRcs.LG
收藏

基于神经迁移学习的C代码安全漏洞修复

Neural Transfer Learning for Repairing Security Vulnerabilities in C Code

KTH Royal Institute of Technology(瑞典皇家理工学院);Colorado State University(科罗拉多州立大学)

Zimin Chen, Steve Kommrusch, Martin Monperrus

摘要:

在本文中,我们解决了深度学习自动修复软件漏洞的问题。数据驱动漏洞修复的主要问题是,已知已确认漏洞的少数现有数据集仅包含几千个示例。然而,训练一个深度学习模型通常需要数十万个示例。在这项工作中,我们利用直觉,错误修复任务和漏洞修复任务是相关的,从错误修复学到的知识可以转移到修复漏洞。在机器学习社区中,这种技术被称为迁移学习。本文提出了一种基于迁移学习的安全漏洞修复方法VRepair。VRepair首先在一个大型的bug修复语料库上进行训练,然后在一个小一个数量级的漏洞修复数据集上进行调整。在我们的实验中,我们证明了只在bug修复语料库上训练的模型已经可以修复一些漏洞。然后,我们证明了迁移学习提高了修复脆弱C函数的能力。我们还表明,迁移学习模型的性能优于使用去噪任务训练并在漏洞修复任务上进行微调的模型。总之,本文表明,与在小数据集上学习相比,迁移学习在修复C中的安全漏洞方面效果良好。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑