arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.11853cs.CRcs.SE
收藏

Exploring Security Commits in Python(Python中的安全提交探究)

Exploring Security Commits in Python

Shiyu Sun, Shu Wang, Xinda Wang, Yunlong Xing, Elisa Zhang, Kun Sun

AI总结:

本研究针对Python中未被CVE收录的静默安全提交难以识别的问题,构建了首个Python安全提交数据集PySecDB,提出CommitCPG图表示与SCOPY多属性图学习模型提升数据收集效率,还发现了覆盖超85%安全提交的四种常见修复模式。

摘要:

Python因对初学者友好,已成为最受欢迎的编程语言。然而近期一项研究发现,Python中的大多数安全问题并未被CVE(通用漏洞披露)收录,可能仅通过“静默”安全提交修复,这对软件安全构成威胁,也阻碍了下游软件的安全修复。识别隐藏的安全提交至关重要,但现有数据集和方法在Python安全提交检测中存在不足,原因在于数据种类有限、代码语义不全面,以及学到的特征不具备可解释性。\n本文构建了首个Python安全提交数据集PySecDB,该数据集包含三个子集:基础数据集、试点数据集和增强数据集。基础数据集收录了与MITRE提供的CVE记录相关联的安全提交。为丰富安全提交的种类,我们通过过滤提交消息中的关键词,从GitHub构建了试点数据集。由于并非所有提交都包含提交消息,我们进一步通过理解代码变更的语义构建了增强数据集。为构建增强数据集,我们提出了一种名为CommitCPG的新型图表示方法,以及名为SCOPY的多属性图学习模型,通过序列和结构层面的代码语义识别安全提交候选。评估结果显示,我们提出的算法可将数据收集效率提升最高40个百分点。经三位安全专家人工验证,PySecDB包含1258条安全提交和2791条非安全提交。此外,我们基于PySecDB开展了广泛的案例研究,发现了四种常见的安全修复模式,覆盖了Python中超过85%的安全提交,为安全软件维护、漏洞检测和自动化程序修复提供了参考。

英文摘要:

Python has become the most popular programming language as it is friendly to work with for beginners. However, a recent study has found that most security issues in Python have not been indexed by CVE and may only be fixed by 'silent' security commits, which pose a threat to software security and hinder the security fixes to downstream software. It is critical to identify the hidden security commits; however, the existing datasets and methods are insufficient for security commit detection in Python, due to the limited data variety, non-comprehensive code semantics, and uninterpretable learned features. In this paper, we construct the first security commit dataset in Python, namely PySecDB, which consists of three subsets including a base dataset, a pilot dataset, and an augmented dataset. The base dataset contains the security commits associated with CVE records provided by MITRE. To increase the variety of security commits, we build the pilot dataset from GitHub by filtering keywords within the commit messages. Since not all commits provide commit messages, we further construct the augmented dataset by understanding the semantics of code changes. To build the augmented dataset, we propose a new graph representation named CommitCPG and a multi-attributed graph learning model named SCOPY to identify the security commit candidates through both sequential and structural code semantics. The evaluation shows our proposed algorithms can improve the data collection efficiency by up to 40 percentage points. After manual verification by three security experts, PySecDB consists of 1,258 security commits and 2,791 non-security commits. Furthermore, we conduct an extensive case study on PySecDB and discover four common security fix patterns that cover over 85% of security commits in Python, providing insight into secure software maintenance, vulnerability detection, and automated program repair.

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

↑