Software vulnerabilities are now reported at an unprecedented speed due to the recent development of automated vulnerability hunting tools. However, fixing vulnerabilities still mainly depends on programmers' manual efforts. Developers need to deeply understand the vulnerability and try to affect the system's functions as little as possible. In this paper, with the advancement of Neural Machine Translation (NMT) techniques, we provide a novel approach called SeqTrans to exploit historical vulnerability fixes to provide suggestions and automatically fix the source code. To capture the contextual information around the vulnerable code, we propose to leverage data flow dependencies to construct code sequences and fed them into the state-of-the-art transformer model. The fine-tuning strategy has been introduced to overcome the small sample size problem. We evaluate SeqTrans on a dataset containing 1,282 commits that fix 624 vulnerabilities in 205 Java projects. Results show that the accuracy of SeqTrans outperforms the latest techniques and achieves 23.3% in statement-level fix and 25.3% in CVE-level fix. In the meantime, we look deep inside the result and observe that NMT model performs very well in certain kinds of vulnerabilities like CWE-287 (Improper Authentication) and CWE-863 (Incorrect Authorization).
翻译:由于最近开发了自动脆弱性狩猎工具,软件的脆弱程度现已以前所未有的速度得到报告。然而,确定脆弱程度仍主要取决于程序员的手工工作。开发者需要深入理解脆弱性,并尽量少地影响系统功能。在本文件中,随着神经机器翻译技术的进步,我们提供了一种新颖的方法,称为SeqTrans(SeqTrans),以利用历史脆弱程度的固定方法,提供建议和自动修正源代码。为了捕捉脆弱代码周围的背景信息,我们提议利用数据流动依赖度来构建代码序列并将其输入最新变异器模型。我们采用了微调战略,以克服小规模的样本问题。我们用包含1,282个数据集来评估SeqTrans(Seq Transmission),承诺在205 Java项目中修复624个脆弱性。结果显示Seqreatrans(Sequrity)的准确性超越了最新技术,在声明级固定中达到了23.3%,在CVE级修正中达到了25.3%。与此同时,我们深入地看到NMT模型在CWE-287(GRAFI)和CRUIRAVI(GI)中非常-87)等某些脆弱性非常。