Finding application errors and security flaws using PQL: a program query language

被引:141
|
作者
Martin, M [1 ]
Livshits, B [1 ]
Lam, MS [1 ]
机构
[1] Stanford Univ, Dept Comp Sci, Stanford, CA 94305 USA
关键词
languages; security; reliability; program traces; pattern matching; web applications; SQL injection; resource leaks; bug finding;
D O I
10.1145/1103845.1094840
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
A number of effective error detection tools have been built in recent years to check if a program conforrns to certain design rules. An important class of design rules deals with sequences of events associated with a set of related objects. This paper presents a language called PQL (Program Query Language) that allows programmers to express such questions easily in an application-specific context. A query looks like a code excerpt corresponding to the shortest amount of code that would violate a design rule. Details of the target application's precise implementation are abstracted away. The programmer may also specify actions to perform when a match is found, such as recording relevant information or even correcting an erroneous execution on the fly. We have developed both static and dynamic techniques to find solutions to PQL queries. Our static analyzer finds all potential matches conservatively using a context-sensitive, flow-insensitive, inclusion-based pointer alias analysis. Static results are also useful in reducing the number of instrumentation points for dynamic analysis. Our dynamic analyzer instruments the source program to catch all violations precisely as the program runs and to optionally perform user-specified actions. We have implemented the techniques described in this paper and found 206 errors in 6 large real-world open-source Java applications containing a total of nearly 60,000 classes. These errors are important security flaws, resource leaks, and violations of consistency invariants. The combination of static and dynamic analysis proves effective at addressing a wide range of debugging and program comprehension queries. We have found that dynamic analysis is especially suitable for preventing errors such as security vulnerabilities at runtime.
引用
收藏
页码:365 / 383
页数:19
相关论文
共 2 条
  • [1] Experience in using a typed functional language for the development of a security application
    Doligez, Damien
    Faure, Christele
    Hardin, Therese
    Maarek, Manuel
    [J]. ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2014, (149): : 58 - 63
  • [2] Adversary Simulation of Structured Query Language (SQL) Injection Attack Using Genetic Algorithm forWeb Application Firewalls (WAF) Bypass
    Bahruddin, Habib
    Suryani, Vera
    Wardana, Aulia Arif
    [J]. INTELLIGENT SYSTEMS AND APPLICATIONS, VOL 2, INTELLISYS 2023, 2024, 823 : 656 - 669