CastSan: Efficient Detection of Polymorphic {C++} Object Type Confusions with {LLVM}
C++ object type confusion vulnerabilities as the result of illegal object casting have been threatening systems’ security for decades. While there exist several solutions to address this type of vulnerability, none of them are sufficiently practical for adoption in production scenarios. Most competitive and recent solutions require object type tracking for checking polymorphic object casts, and all have prohibitively high runtime overhead. The main source of overhead is the need to track the object type during runtime for both polymorphic and non-polymorphic object casts. In this paper, we present CastSan, a C++ object type confusion detection tool for polymorphic objects only, which scales efficiently to large and complex code bases as well as to many concurrent threads. To considerably reduce the object type cast checking overhead, we employ a new technique based on constructing the whole virtual table hierarchy during program compile time. Since CastSan does not rely on keeping track of the object type during runtime, the overhead is drastically reduced. Our evaluation results show that complex applications run insignificantly slower when our technique is deployed, thus making CastSan a real-world usage candidate. Finally, we envisage that based on our object type confusion detection technique, which relies on ordered virtual tables (vtables), even non-polymorphic object casts could be precisely handled by constructing auxiliary non-polymorphic function table hierarchies for static classes as well.
CastSan: Efficient Detection of Polymorphic {C++} Object Type Confusions with {LLVM}
Computer Security - 23rd European Symposium on Research in Computer Security, {ESORICS} 2018, Barcelona, Spain, September 3-7, 2018, Proceedings, Part {I}
Authors: | Paul Muntean, Sebastian Wuerl, Jens Grossklags, and Claudia Eckert |
Year/month: | 2018/8 |
Booktitle: | Computer Security - 23rd European Symposium on Research in Computer Security, {ESORICS} 2018, Barcelona, Spain, September 3-7, 2018, Proceedings, Part {I} |
Pages: | 3--25 |
Fulltext: | click here |
Abstract |
|
C++ object type confusion vulnerabilities as the result of illegal object casting have been threatening systems’ security for decades. While there exist several solutions to address this type of vulnerability, none of them are sufficiently practical for adoption in production scenarios. Most competitive and recent solutions require object type tracking for checking polymorphic object casts, and all have prohibitively high runtime overhead. The main source of overhead is the need to track the object type during runtime for both polymorphic and non-polymorphic object casts. In this paper, we present CastSan, a C++ object type confusion detection tool for polymorphic objects only, which scales efficiently to large and complex code bases as well as to many concurrent threads. To considerably reduce the object type cast checking overhead, we employ a new technique based on constructing the whole virtual table hierarchy during program compile time. Since CastSan does not rely on keeping track of the object type during runtime, the overhead is drastically reduced. Our evaluation results show that complex applications run insignificantly slower when our technique is deployed, thus making CastSan a real-world usage candidate. Finally, we envisage that based on our object type confusion detection technique, which relies on ordered virtual tables (vtables), even non-polymorphic object casts could be precisely handled by constructing auxiliary non-polymorphic function table hierarchies for static classes as well. |
Bibtex:
@inproceedings { DBLP:conf/esorics/MunteanWGE18,author = { Paul Muntean and Sebastian Wuerl and Jens Grossklags and Claudia Eckert},
title = { CastSan: Efficient Detection of Polymorphic {C++} Object Type Confusions with {LLVM} },
year = { 2018 },
month = { August },
booktitle = { Computer Security - 23rd European Symposium on Research in Computer Security, {ESORICS} 2018, Barcelona, Spain, September 3-7, 2018, Proceedings, Part {I} },
pages = { 3--25 },
url = { https://doi.org/10.1007/978-3-319-99073-6_1 },
}