arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.18529cs.PL
收藏

实用的基于类型的污点检查与推断(扩展版)

Practical Type-Based Taint Checking and Inference (Extended Version)

Nima Karimipour, Kanak Das, Manu Sridharan, Behnaz Hassanshahi

AI总结:

针对现有污点分析的可扩展性与误报问题,提出基于类型的污点检查新方法TaintTyper,通过优化第三方库处理与自动推断类型限定符,在保持相当精确度的同时显著提升召回率与检查速度。

摘要:

许多重要的安全属性可以用污点数据的流来表述,因此迫切需要改进的污点分析工具来防止此类数据流。大多数现有的污点分析使用整个程序的静态分析,导致了可扩展性方面的挑战。基于类型的检查是一种很有前途的替代方案,因为它能够进行模块化和增量检查,从而实现快速的性能。然而,由于误报和对现有代码库进行注释的挑战,基于类型的方法在实践中并未得到广泛采用。在本文中,我们提出了一种新的基于类型的污点属性检查方法来解决这些挑战,该方法基于两项关键技术。首先,我们提出了一种新的基于类型的污点检查器,通过对第三方库和其他语言结构进行更实用的处理,显著减少了误报。其次,我们提出了一种自动推断现有代码的污点类型限定符的新技术。我们的技术支持泛型类型参数注释的推断,这对于污点属性至关重要。我们在工具 TaintTyper 中实现了我们的技术,并在真实世界的基准测试上进行了评估。TaintTyper 超过了最先进的整个程序污点分析器的召回率,具有相当的精确度,并且检查时间快了 2.93 倍到 22.9 倍。此外,TaintTyper 推断出的注释与手动编写的注释相当,适合插入到源代码中。TaintTyper 是一种很有前途的、高效且实用的污点检查新方法。

英文摘要:

Many important security properties can be formulated in terms of flows of tainted data, and improved taint analysis tools to prevent such flows are of critical need. Most existing taint analyses use whole-program static analysis, leading to scalability challenges. Type-based checking is a promising alternative, as it enables modular and incremental checking for fast performance. However, type-based approaches have not been widely adopted in practice, due to challenges with false positives and annotating existing codebases. In this paper, we present a new approach to type-based checking of taint properties that addresses these challenges, based on two key techniques. First, we present a new type-based tainting checker with significantly reduced false positives, via more practical handling of third-party libraries and other language constructs. Second, we present a novel technique to automatically infer tainting type qualifiers for existing code. Our technique supports inference of generic type argument annotations, crucial for tainting properties. We implemented our techniques in a tool TaintTyper and evaluated it on real-world benchmarks. TaintTyper exceeds the recall of a state-of-the-art whole-program taint analyzer, with comparable precision, and 2.93X-22.9X faster checking time. Further, TaintTyper infers annotations comparable to those written by hand, suitable for insertion into source code. TaintTyper is a promising new approach to efficient and practical taint checking.

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

↑