arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2303.16591cs.SE
收藏

一种基于AST的代码变化表示及其在JUST-IN-TIME漏洞预测中的性能

An AST-based Code Change Representation and its Performance in Just-in-time Vulnerability Prediction

Tamás Aladics, Péter Hegedűs, Rudolf Ferenc

摘要:

软件漏洞的存在是软件开发中日益严重的问题。在大多数情况下,当易受攻击的片段被添加到代码库时,期望尽可能早地检测到易受攻击性,优选地以及时的方式。业界很难解决这个问题,因为人工检查成本高昂,而且传统的方法(如基于规则的漏洞检测)不够强大,无法跟上新漏洞出现的步伐。积极研究的机器学习领域可以帮助在这种情况下,模型可以被训练来检测脆弱的模式。然而,机器学习模型只有在数据被适当地表示时才能很好地工作。在我们的工作中,我们提出了一种新的方式来表示源代码中的变化(即代码提交),代码更改树,一种形式,旨在只保留Java源代码的两个抽象语法树之间的差异。我们比较了它在预测代码更改是否会针对多种表示类型引入漏洞方面的有效性,并通过许多机器学习模型作为基线对其进行了评估。评估是在一个新的数据集上完成的,我们使用2阶段数据集生成器方法将其作为我们贡献的一部分。根据我们的评估,我们得出结论,使用代码更改树是一个有效的和有效的选择,以表示源代码的变化,因为它提高了性能。

英文摘要:

The presence of software vulnerabilities is an ever-growing issue in software development. In most cases, it is desirable to detect vulnerabilities as early as possible, preferably in a just-in-time manner, when the vulnerable piece is added to the code base. The industry has a hard time combating this problem as manual inspection is costly and traditional means, such as rule-based bug detection, are not robust enough to follow the pace of the emergence of new vulnerabilities. The actively researched field of machine learning could help in such situations as models can be trained to detect vulnerable patterns. However, machine learning models work well only if the data is appropriately represented. In our work, we propose a novel way of representing changes in source code (i.e. code commits), the Code Change Tree, a form that is designed to keep only the differences between two abstract syntax trees of Java source code. We compared its effectiveness in predicting if a code change introduces a vulnerability against multiple representation types and evaluated them by a number of machine learning models as a baseline. The evaluation is done on a novel dataset that we published as part of our contributions using a 2-phase dataset generator method. Based on our evaluation we concluded that using Code Change Tree is a valid and effective choice to represent source code changes as it improves performance.

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

↑