Machine-Learning-Guided Typestate Analysis for Static Use-After-Free Detection

被引:31
|
作者
Yan, Hua [1 ,2 ]
Sui, Yulei [3 ,4 ]
Chen, Shiping [2 ]
Xue, Jingling
机构
[1] Univ New South Wales, Sch Comp Sci & Engn, Sydney, NSW, Australia
[2] CSIRO, Data61, Canberra, ACT, Australia
[3] Univ Technol Sydney, CAI, Sydney, NSW, Australia
[4] Univ Technol Sydney, Sch Software, Sydney, NSW, Australia
基金
澳大利亚研究理事会;
关键词
use-after-free; vulnerability detection; static analysis; machine learning; SUPPORT; SAFETY; TOOL;
D O I
10.1145/3134600.3134620
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Typestate analysis relies on pointer analysis for detecting temporal memory safety errors, such as use-after-free (UAF). For large programs, scalable pointer analysis is usually imprecise in analyzing their hard "corner cases", such as infeasible paths, recursion cycles, loops, arrays, and linked lists. Due to a sound over-approximation of the points-to information, a large number of spurious aliases will be reported conservatively, causing the corresponding typestate analysis to report a large number of false alarms. Thus, the usefulness of typestate analysis for heap-intensive clients, like UAF detection, becomes rather limited, in practice. We introduce TAC, a static UAF detector that bridges the gap between typestate and pointer analyses by machine learning. TAC learns the correlations between program features and UAF-related aliases by using a Support Vector Machine (SVM) and applies this knowledge to further disambiguate the UAF-related aliases reported imprecisely by the pointer analysis so that only the ones validated by its SVM classifier are further investigated by the typestate analysis. Despite its unsoundness, TAC represents a practical typestate analysis approach for UAF detection. We have implemented TAC in LLVM-3.8.0 and evaluated it using a set of eight open-source C/C++ programs. The results show that TAC is effective (in terms of finding 5 known CVE vulnerabilities, 1 known bug, and 8 new bugs with a low false alarm rate) and scalable (in terms of analyzing a large codebase with 2,098 KLOC in just over 4 hours).
引用
收藏
页码:42 / 54
页数:13
相关论文
共 50 条
  • [1] Typestate-Guided Fuzzer for Discovering Use-after-Free Vulnerabilities
    Wang, Haijun
    Xie, Xiaofei
    Li, Yi
    Wen, Cheng
    Li, Yuekang
    Liu, Yang
    Qin, Shengchao
    Chen, Hongxu
    Sui, Yulei
    [J]. 2020 ACM/IEEE 42ND INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2020), 2020, : 999 - 1010
  • [2] Machine-Learning-Guided Selectively Unsound Static Analysis
    Heo, Kihong
    Oh, Hakjoo
    Yi, Kwangkeun
    [J]. 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2017, : 519 - 529
  • [3] Scalable Static Detection of Use-After-Free Vulnerabilities in Binary Code
    Zhu, Kailong
    Lu, Yuliang
    Huang, Hui
    [J]. IEEE ACCESS, 2020, 8 : 78713 - 78725
  • [4] POSTER: UAFChecker: Scalable Static Detection of Use-After-Free Vulnerabilities
    Ye, Jiayi
    Zhang, Chao
    Han, Xinhui
    [J]. CCS'14: PROCEEDINGS OF THE 21ST ACM CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY, 2014, : 1529 - 1531
  • [5] An Efficient Metric-Based Approach for Static Use-After-Free Detection
    Wei, Haolai
    Chen, Liwei
    Nie, Xiaofan
    Zhang, Zhijie
    Zhang, Yuantong
    Shi, Gang
    [J]. 2022 IEEE INTL CONF ON PARALLEL & DISTRIBUTED PROCESSING WITH APPLICATIONS, BIG DATA & CLOUD COMPUTING, SUSTAINABLE COMPUTING & COMMUNICATIONS, SOCIAL COMPUTING & NETWORKING, ISPA/BDCLOUD/SOCIALCOM/SUSTAINCOM, 2022, : 58 - 65
  • [6] Dynamic Detection of Use-After-Free Bugs
    S. A. Asryan
    S. S. Gaissaryan
    Sh. F. Kurmangaleev
    A. M. Aghabalyan
    N. G. Hovsepyan
    S. S. Sargsyan
    [J]. Programming and Computer Software, 2019, 45 : 365 - 371
  • [7] Machine-Learning-Guided Discovery of Electrochemical Reactions
    Zahrt, Andrew F.
    Mo, Yiming
    Nandiwale, Kakasaheb Y.
    Shprints, Ron
    Heid, Esther
    Jensen, Klavs F.
    [J]. JOURNAL OF THE AMERICAN CHEMICAL SOCIETY, 2022, 144 (49) : 22599 - 22610
  • [8] Dynamic Detection of Use-After-Free Bugs
    Asryan, S. A.
    Gaissaryan, S. S.
    Kurmangaleev, Sh F.
    Aghabalyan, A. M.
    Hovsepyan, N. G.
    Sargsyan, S. S.
    [J]. PROGRAMMING AND COMPUTER SOFTWARE, 2019, 45 (07) : 365 - 371
  • [9] DangSan: Scalable Use-after-free Detection
    van der Kouwe, Erik
    Nigade, Vinod
    Giuffrida, Cristiano
    [J]. PROCEEDINGS OF THE TWELFTH EUROPEAN CONFERENCE ON COMPUTER SYSTEMS (EUROSYS 2017), 2017, : 405 - 419
  • [10] UFO: Predictive Concurrency Use-After-Free Detection
    Huang, Jeff
    [J]. PROCEEDINGS 2018 IEEE/ACM 40TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2018, : 609 - 619