信息网络安全 ›› 2022, Vol. 22 ›› Issue (9): 40-45.doi: 10.3969/j.issn.1671-1122.2022.09.005

• 技术研究 • 上一篇    下一篇

基于数据流追溯的空指针引用挖掘系统

文伟平(), 刘成杰, 时林   

  1. 北京大学软件与微电子学院,北京 100080
  • 收稿日期:2022-05-31 出版日期:2022-09-10 发布日期:2022-11-14
  • 通讯作者: 文伟平 E-mail:weipingwen@pku.edu.cn
  • 作者简介:文伟平(1976—),男,湖南,教授,博士,主要研究方向为系统与网络安全、大数据与云安全、智能计算安全|刘成杰(1998—),男,湖南,硕士研究生,主要研究方向为软件安全、漏洞挖掘、入侵检测|时林(1998—),男,山东,硕士研究生,主要研究方向为漏洞挖掘、软件安全防护
  • 基金资助:
    国家自然科学基金(61872011)

A Null Pointer Reference Mining System Based on Data Flow Tracing

WEN Weiping(), LIU Chengjie, SHI Lin   

  1. School of Software and Microelectronics, Peking University, Beijing 100080, China
  • Received:2022-05-31 Online:2022-09-10 Published:2022-11-14
  • Contact: WEN Weiping E-mail:weipingwen@pku.edu.cn

摘要:

空指针异常引用是系统运行过程中的一种常见问题,该问题会引起程序崩溃或者异常退出,同时攻击者也可以利用空指针解引用来完成任意读写操作,导致信息泄露。Java作为一种广泛使用的语言,也存在空指针引用问题,主要原因是对引用变量的指向检查不足。文章提出一种基于数据流追溯的空指针引用检测系统,并设计了静态分析工具jvd。该工具通过特化追踪空指针在容器中的传播,使得空指针变量不会在容器中传播丢失,在中间语言Jimple层面上完成检测并覆盖多种空指针容器传播场景,有效降低复杂场景下的漏报率。在Juliet Test Suite的CWE476号测试集上,将文章所设计的jvd与SpotBugs、Infer等工具进行对比实验。实验结果表明,jvd能够在多种空指针传播场景下使用,在高精度场景下能够取得比其他工具更好的效果。

关键词: 数据流分析, 空指针解引用, Jimple, 容器传播

Abstract:

Null pointer dereference is a common defect in programming, which often causes the program crash or abnormal exit. At the same time, attackers can also use null pointer dereference to complete arbitrary read and write operations, leading to information disclosure. Java is a widely used language, and also suffers from null pointer dereference due to insufficient checks on dereference. In order to avoid the potential risk, this paper proposed a null pointer dereference detection system based on data flow analysis and designed a static analysis tool jvd. This tool implemented analysis on Jimple and covered multiple container propagation cases, especially in containers by special treatment, which effectively reduced the false negative rate in complex scenarios. This paper completed the experiment and compared jvd with several popular tools like SpotBugs and Infer on CWE476 test dataset in Juliet Test Suite, which shows that jvd could be used in multiple null pointer transmission and achieved excellent performance in high accuracy situation.

Key words: data flow analysis, null pointer dereference, Jimple, container propagation

中图分类号: