挑战机器学习算法预测易受攻击的 JavaScript 函数
Challenging Machine Learning Algorithms in Predicting Vulnerable JavaScript Functions
AI总结:
本文基于 Node Security Project、Snyk 和 GitHub 漏洞修复数据构建数据集,比较 8 种机器学习算法预测 JavaScript 易受攻击函数的效果,发现 KNN 表现最佳。
摘要:
网络犯罪活动的迅速增加以及受其威胁的设备数量不断增长,使软件安全问题成为关注焦点。由于约 90% 的攻击利用了已知类型的安全问题,因此发现易受攻击的组件并应用现有缓解技术,是打击网络犯罪的一种可行实用方法。本文研究包括一种流行深度学习算法在内的最新机器学习技术,在预测 JavaScript 程序中可能存在安全漏洞的函数时表现如何。我们应用 8 种机器学习算法构建预测模型,所用新数据集是为本研究根据 Node Security Project 和 Snyk 平台公共数据库中的漏洞信息,以及来自 GitHub 的代码修复补丁构建的。我们使用静态源代码指标作为预测因子,并采用广泛的网格搜索算法寻找表现最佳的模型。我们还考察了各种重采样策略在处理数据集不平衡特性方面的效果。表现最佳的算法是 KNN,其建立的易受攻击函数预测模型 F-measure 为 0.76(精确率 0.91、召回率 0.66)。此外,深度学习、基于树和森林的分类器以及 SVM 也具有竞争力,F-measure 均超过 0.70。尽管 F-measure 并未随重采样策略发生显著变化,但精确率和召回率的分布确实发生了改变。不进行重采样似乎会产生偏好高精确率的模型,而重采样策略则平衡了信息检索指标。
英文摘要:
The rapid rise of cyber-crime activities and the growing number of devices threatened by them place software security issues in the spotlight. As around 90% of all attacks exploit known types of security issues, finding vulnerable components and applying existing mitigation techniques is a viable practical approach for fighting against cyber-crime. In this paper, we investigate how the state-of-the-art machine learning techniques, including a popular deep learning algorithm, perform in predicting functions with possible security vulnerabilities in JavaScript programs. We applied 8 machine learning algorithms to build prediction models using a new dataset constructed for this research from the vulnerability information in public databases of the Node Security Project and the Snyk platform, and code fixing patches from GitHub. We used static source code metrics as predictors and an extensive grid-search algorithm to find the best performing models. We also examined the effect of various re-sampling strategies to handle the imbalanced nature of the dataset. The best performing algorithm was KNN, which created a model for the prediction of vulnerable functions with an F-measure of 0.76 (0.91 precision and 0.66 recall). Moreover, deep learning, tree and forest based classifiers, and SVM were competitive with F-measures over 0.70. Although the F-measures did not vary significantly with the re-sampling strategies, the distribution of precision and recall did change. No re-sampling seemed to produce models preferring high precision, while re-sampling strategies balanced the IR measures.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。