计算机科学与探索 ›› 2021, Vol. 15 ›› Issue (2): 270-283.DOI: 10.3778/j.issn.1673-9418.2004027

• 网络与信息安全 • 上一篇    下一篇

面向Java EE程序的SQLIA漏洞分析和验证方法

郭帆,范威威   

  1. 江西师范大学 计算机信息工程学院,南昌 330022
  • 出版日期:2021-02-01 发布日期:2021-02-01

Analysis and Verification on SQLIA Vulnerability for Java EE Programs

GUO Fan, FAN Weiwei   

  1. School of Computer and Information Engineering, Jiangxi Normal University, Nanchang 330022, China
  • Online:2021-02-01 Published:2021-02-01

摘要:

SQLIA漏洞破坏Web后台数据库的完整性,一直是Web应用安全的主要威胁。提出一种检测和验证Java Web程序的SQLIA漏洞的解决方案,将静态分析与动态验证相结合,并且形式化定义指令级污点传播操作语义,能够有效跟踪跨文件和跨页面的污点传播。静态分析首先对Source进行预处理和分类得到真实可靠的Source集合,然后应用方法、请求、会话、方法调用等多重关系匹配潜在的Source和Sink对,使得分析过程可以过滤无关Source和Sink,最后结合静态污点分析和活跃变量分析排除不可能存在污点传播路径的Source和Sink。动态验证首先对程序插桩,然后在执行程序的同时进行动态污点传播并生成Trace,基于Trace验证静态分析结果的正确性,获得真实污点传播路径的漏洞集合。原型系统基于Soot框架实现,对若干开源程序的实验结果表明了方法的有效性。

关键词: SQL注入, 污点传播语义, 静态分析, 活跃变量分析, 插桩, 动态验证

Abstract:

SQLIA vulnerabilities undermine the integrity of the Web background database, and have always been a major threat to Web application security. This paper proposes a solution to detect and verify SQLIA vulnerabilities in Java Web programs. It combines static analysis and dynamic verification, and formalizes the definition of instruction- level taint propagation semantics, which can effectively track the spread of taint information across files and pages. Static analysis first handles and classifies Sources to obtain a true and reliable Source collection, and then applies the multiple-fold relationship of methods, requests, sessions, method calls, etc. to match the potential Source and Sink pair, so that the analysis process can filter the unrelated Sources and Sinks. Finally, this paper combines static taint analysis and live variables analysis to eliminate Sources and Sinks where there is no taint propagation paths. Dynamic verification first instruments the program, then performs dynamic taint propagation and produces a trace while executing it. After that, it verifies the correctness of the results of static analysis by analyzing the trace, and obtains real bugs with taint propagation paths. A prototype system is implemented on top of Soot, and experimental results of several open source programs show the effectiveness of the approach.

Key words: structured query language (SQL) injection, taint propagation semantics, static analysis, live variable analysis, instrumentation, dynamic verification