HexType: Efficient Detection of Type Confusion Errors for C plus

被引:22
|
作者
Jeon, Yuseok [1 ]
Biswas, Priyam [1 ]
Carr, Scott [1 ]
Lee, Byoungyoung [1 ]
Payer, Mathias [1 ]
机构
[1] Purdue Univ, W Lafayette, IN 47907 USA
基金
美国国家科学基金会;
关键词
Type confusion; Bad casting; Type safety; Typecasting; Static_cast; Dynamic_cast; Reinterpret_cast; SAFETY;
D O I
10.1145/3133956.3134062
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Type confusion, often combined with use-after-free, is the main attack vector to compromise modern C++ software like browsers or virtual machines. Typecasting is a core principle that enables modularity in C++. For performance, most typecasts are only checked statically, i.e., the check only tests if a cast is allowed for the given type hierarchy, ignoring the actual runtime type of the object. Using an object of an incompatible base type instead of a derived type results in type confusion. Attackers abuse such type confusion issues to attack popular software products including Adobe Flash, PHP, Google Chrome, or Firefox. We propose to make all type checks explicit, replacing static checks with full runtime type checks. To minimize the performance impact of our mechanism HexType, we develop both low-overhead data structures and compiler optimizations. To maximize detection coverage, we handle specific object allocation patterns, e.g., placement new or re int erpret_cast which are not handled by other mechanisms. Our prototype results show that, compared to prior work, Hex Type has at least 1.1- 6.1 times higher coverage on Firefox benchmarks. For SPEC CPU2006 benchmarks with overhead, we show a 2 - 33.4 times reduction in overhead. In addition, HexType discovered 4 new type confusion bugs in Qt and Apache Xerces-C++.
引用
收藏
页码:2373 / 2387
页数:15
相关论文
共 50 条
  • [1] TCD: Statically Detecting Type Confusion Errors in C plus plus Programs
    Zou, Changwei
    Sui, Yulei
    Yan, Hua
    Xue, Jingling
    [J]. 2019 IEEE 30TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE), 2019, : 292 - 302
  • [2] Early Detection of Type Errors in C plus plus Templates
    Chen, Sheng
    Erwig, Martin
    [J]. PEPM '14: PROCEEDINGS OF THE ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND PROGRAM MANIPULATION, 2014, : 133 - 144
  • [3] CASTSAN: Efficient Detection of Polymorphic C plus plus Object Type Confusions with LLVM
    Muntean, Paul
    Wuerl, Sebastian
    Grossklags, Jens
    Eckert, Claudia
    [J]. COMPUTER SECURITY (ESORICS 2018), PT I, 2018, 11098 : 3 - 25
  • [4] Efficient detection of dangling pointer error for C/C plus plus programs
    Zhang, Wenzhe
    [J]. 2ND ANNUAL INTERNATIONAL CONFERENCE ON INFORMATION SYSTEM AND ARTIFICIAL INTELLIGENCE (ISAI2017), 2017, 887
  • [5] Open and Efficient Type Switch for C plus
    Solodkyy, Yuriy
    Dos Reis, Gabriel
    Stroustrup, Bjarne
    [J]. ACM SIGPLAN NOTICES, 2012, 47 (10) : 963 - 982
  • [6] Mapping to Bits: Efficiently Detecting Type Confusion Errors
    Pang, Chengbin
    Du, Yunlan
    Mao, Bing
    Guo, Shanqing
    [J]. 34TH ANNUAL COMPUTER SECURITY APPLICATIONS CONFERENCE (ACSAC 2018), 2018, : 518 - 528
  • [7] Efficient Data Race Detection for C/C plus plus Programs Using Dynamic Granularity
    Song, Young Wn
    Lee, Yann-Hang
    [J]. 2014 IEEE 28TH INTERNATIONAL PARALLEL AND DISTRIBUTED PROCESSING SYMPOSIUM, 2014,
  • [8] Accelerating Type Confusion Detection with Pointer Analysis
    Fan, Xiaokang
    Xia, Zeyu
    Long, Sifan
    Huang, Chun
    Yang, Canqun
    [J]. IAENG International Journal of Computer Science, 2020, 47 (04) : 1 - 8
  • [9] Accelerating Type Confusion Detection by Identifying Harmless Type Castings
    Fan, Xiaokang
    Long, Sifan
    Huang, Chun
    Yang, Canqun
    Li, Fa
    [J]. PROCEEDINGS OF THE 20TH ACM INTERNATIONAL CONFERENCE ON COMPUTING FRONTIERS 2023, CF 2023, 2023, : 91 - 100
  • [10] EFFICIENT SPOKEN TERM DETECTION USING CONFUSION NETWORKS
    Mangu, Lidia
    Kingsbury, Brian
    Soltau, Hagen
    Kuo, Hong-Kwang
    Picheny, Michael
    [J]. 2014 IEEE INTERNATIONAL CONFERENCE ON ACOUSTICS, SPEECH AND SIGNAL PROCESSING (ICASSP), 2014,