Lune

NDSS2025顶会

type++: Prohibiting Type Confusion with Inline Type Information

Nicolas Badoux, Flavio Toffalini, Yuseok Jeon, Mathias Payer

摘要

—Type confusion, or bad casting, is a common C++ attack vector. Such vulnerabilities cause a program to interpret an object as belonging to a different type, enabling powerful attacks, like control-flow hijacking. C++ restricts runtime checks to polymorphic classes because only those have inline type information. The lack of runtime type information throughout an object’s lifetime makes it challenging to enforce continuous checks and thereby prevent type confusion during downcasting. Current solutions either record type information for all objects disjointly, incurring prohibitive runtime overhead, or restrict protection to a fraction of all objects. Our C++ dialect, type++, enforces the paradigm that each allocated object involved in downcasting carries type information throughout its lifetime, ensuring correctness by enabling type checks wherever and whenever necessary. As not just polymorphic objects but all objects are typed, all down-to casts can now be dynamically verified. Compared to existing solutions, our strategy greatly reduces runtime cost and enables type++ usage both during testing and as mitigation. Targeting SPEC CPU2006 and CPU2017, we compile and run 2,040 kLoC, while changing only 314 LoC. To help developers, our static analysis warns where code changes in target programs may be necessary. Running the compiled benchmarks results in negligible performance overhead (1.19% on SPEC CPU2006 and 0.82% on SPEC CPU2017) verifying a total of 90B casts (compared to 3.8B for the state-of-the-art, a 23× improvement). type++ discovers 122 type confusion issues in the SPEC CPU benchmarks among which 14 are new. Targeting Chromium, we change 229 LoC to protect 94.6% of the classes that could be involved in downcasting vulnerabilities

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • SoK: On the Fragility of Memory Error Exploit Mitigations 引用了 Block Oriented Programming: Automating Data-Only Attacks
  • SoK: On the Fragility of Memory Error Exploit Mitigations 引用了 HexType: Efficient Detection of Type Confusion Errors for C++
  • SoK: On the Fragility of Memory Error Exploit Mitigations 引用了 TypeSan: Practical Type Confusion Detection
  • HexType: Efficient Detection of Type Confusion Errors for C++ 引用了 TypeSan: Practical Type Confusion Detection
  • Uncontained: Uncovering Container Confusion in the Linux Kernel 引用了 HexType: Efficient Detection of Type Confusion Errors for C++
  • Uncontained: Uncovering Container Confusion in the Linux Kernel 引用了 TypeSan: Practical Type Confusion Detection
  • Link-Time Optimization of Dynamic Casts in C++ Programs 引用了 HexType: Efficient Detection of Type Confusion Errors for C++
  • Link-Time Optimization of Dynamic Casts in C++ Programs 引用了 TypeSan: Practical Type Confusion Detection
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Link-Time Optimization of Dynamic Casts in C++ ProgramsXufan Lu, Nuno P. LopesPLDI 2025 · 1 次引用
  2. SoK: On the Fragility of Memory Error Exploit MitigationsAdriaan Jacobs, Mahmoud Ammar, Stijn VolckaertUSENIX Security 2026

它引用的 Paper5

  1. Block Oriented Programming: Automating Data-Only AttacksKyriakos K. Ispoglou, Bader AlBassam, Trent Jaeger, Mathias PayerCCS 2018 · 143 次引用
  2. TypeSan: Practical Type Confusion DetectionIstván Haller, Yuseok Jeon, Hui Peng, Mathias Payer 等CCS 2016 · 97 次引用
  3. HexType: Efficient Detection of Type Confusion Errors for C++Yuseok Jeon, Priyam Biswas, Scott A. Carr, Byoungyoung Lee 等CCS 2017 · 67 次引用
  4. Uncontained: Uncovering Container Confusion in the Linux KernelJakob Koschel, Pietro Borrello, Daniele Cono D'Elia, Herbert Bos 等USENIX Security 2023
  5. FUZZILLI: Fuzzing for JavaScript JIT Compiler VulnerabilitiesSamuel Groß, Simon Koch, Lukas Bernhard, Thorsten Holz 等NDSS 2023

相关 Paper

  1. Don't Waste My Efforts: Pruning Redundant Sanitizer Checks by Developer-Implemented Type ChecksYizhuo Zhai, Zhiyun Qian, Chengyu Song, Manu Sridharan 等USENIX Security 2024 · 8 次引用
  2. CFIXX: Object Type Integrity for C++Nathan Burow, Derrick Paul McKee, Scott A. Carr, Mathias PayerNDSS 2018 · 56 次引用
  3. Catamaran: Low-Overhead Memory Safety Enforcement via Parallel AccelerationYiyu Zhang, Tianyi Liu, Zewen Sun, Zhe Chen 等ISSTA 2023 · 3 次引用
  4. SeMalloc: Semantics-Informed Memory AllocatorRuizhe Wang, Meng Xu, N. AsokanCCS 2024
  5. Fuzzing C++ Compilers via Type-Driven MutationBo Wang, Chong Chen, Ming Deng, Junjie Chen 等OOPSLA 2025 · 5 次引用
黄昏的海面,两侧是细线勾勒的悬崖