Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Conferences, Workshops, Symposiums, and Seminars
  4. type++: Prohibiting Type Confusion with Inline Type Information
 
conference paper

type++: Prohibiting Type Confusion with Inline Type Information

Badoux, Nicolas
•
Toffalini, Flavio
•
Jeon, Yuseok
Show more
2025
Proceedings 2025 Network and Distributed System Security Symposium
Network and Distributed System Security Symposium 2025

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++ limits 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 62 are new. Targeting Chromium, we change 229 LoC out of 35 MLoC to protect 94.6% of the classes that could be involved in downcasting vulnerabilities, while incurring only 0.98% runtime overhead compared to the baseline.

  • Details
  • Metrics
Type
conference paper
Author(s)
Badoux, Nicolas
Toffalini, Flavio
Jeon, Yuseok
Payer, Mathias  

École Polytechnique Fédérale de Lausanne

Date Issued

2025

Publisher

Internet Society

Publisher place

Reston, VA

Published in
Proceedings 2025 Network and Distributed System Security Symposium
URL

Video

https://www.youtube.com/watch?v=eWI2pVwjQCY

Slides

https://www.ndss-symposium.org/wp-content/uploads/13d-s0053-badoux.pdf
Editorial or Peer reviewed

REVIEWED

Written at

EPFL

EPFL units
HEXHIVE  
Event nameEvent acronymEvent placeEvent date
Network and Distributed System Security Symposium 2025

NDSS 2025

San Diego, CA, USA

2025-02-24 - 2025-02-28

Available on Infoscience
January 9, 2026
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/257742
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés