小心意外:双峰污点分析
Beware of the Unexpected: Bimodal Taint Analysis
摘要:
静态分析是检测安全漏洞和其他编程问题的强大工具。特别是,全局污点跟踪可以发现跨多个功能的复杂数据流所产生的漏洞。然而,精确地识别哪些流程是有问题的是具有挑战性的,并且有时取决于纯程序分析所不能及的因素,例如惯例和非正式知识。例如,了解到API函数“locale”的参数“name”最终出现在文件路径中是令人惊讶的,并且可能存在问题。相比之下,如果发现传递给API函数“execaCommand”的参数“command”最终被解释为操作系统命令的一部分,这完全不足为奇。本文介绍了Fluffy,一种双峰污点分析,它结合了静态分析,其中数据流的原因,与机器学习,概率确定哪些流是潜在的问题。其关键思想是让机器学习模型从污染流中涉及的自然语言信息(如API名称)进行预测,确定该流是预期的还是意外的,并仅通知开发人员后者。我们提出了一个通用的框架,并实例化它与四个学习模型,这提供了不同的权衡之间的需要注释训练数据和预测的准确性。我们在CodeQL分析框架之上实现了Fluffy,并将其应用于25万个JavaScript项目。通过对五种常见的漏洞类型进行评估,我们发现Fluffy在各种数据集上的其中四种漏洞上获得了0.85或更高的F1分数。
英文摘要:
Static analysis is a powerful tool for detecting security vulnerabilities and other programming problems. Global taint tracking, in particular, can spot vulnerabilities arising from complicated data flow across multiple functions. However, precisely identifying which flows are problematic is challenging, and sometimes depends on factors beyond the reach of pure program analysis, such as conventions and informal knowledge. For example, learning that a parameter "name" of an API function "locale" ends up in a file path is surprising and potentially problematic. In contrast, it would be completely unsurprising to find that a parameter "command" passed to an API function "execaCommand" is eventually interpreted as part of an operating-system command. This paper presents Fluffy, a bimodal taint analysis that combines static analysis, which reasons about data flow, with machine learning, which probabilistically determines which flows are potentially problematic. The key idea is to let machine learning models predict from natural language information involved in a taint flow, such as API names, whether the flow is expected or unexpected, and to inform developers only about the latter. We present a general framework and instantiate it with four learned models, which offer different trade-offs between the need to annotate training data and the accuracy of predictions. We implement Fluffy on top of the CodeQL analysis framework and apply it to 250K JavaScript projects. Evaluating on five common vulnerability types, we find that Fluffy achieves an F1 score of 0.85 or more on four of them across a variety of datasets.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。