Using type analysis in compiler to mitigate integer-overflow-to-buffer-overflow threat

  • Authors:
  • Chao Zhang;Wei Zou;Tielei Wang;Yu Chen;Tao Wei

  • Affiliations:
  • Institute of Computer Science and Technology, Peking University, Beijing, China and Beijing Key Laboratory of Internet Security Technology, Peking University, Beijing, China;Institute of Computer Science and Technology, Peking University, Beijing, China and Beijing Key Laboratory of Internet Security Technology, Peking University, Beijing, China;Institute of Computer Science and Technology, Peking University, Beijing, China and Beijing Key Laboratory of Internet Security Technology, Peking University, Beijing, China;Institute of Computer Science and Technology, Peking University, Beijing, China and Beijing Key Laboratory of Internet Security Technology, Peking University, Beijing, China;Institute of Computer Science and Technology, Peking University, Beijing, China and Beijing Key Laboratory of Internet Security Technology, Peking University, Beijing, China

  • Venue:
  • Journal of Computer Security - ESORICS 2010
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

One of the top two causes of software vulnerabilities in operating systems is the integer overflow. A typical integer overflow vulnerability is the Integer Overflow to Buffer Overflow IO2BO for short vulnerability. IO2BO is an underestimated threat. Many programmers have not realized the existence of IO2BO and its harm. Even for those who are aware of IO2BO, locating and fixing IO2BO vulnerabilities are still tedious and error-prone. Automatically identifying and fixing this kind of vulnerability are critical for software security. In this article, we present the design and implementation of IntPatch, a compiler extension for automatically fixing IO2BO vulnerabilities in C/C++ programs at compile time. IntPatch utilizes classic type theory and a dataflow analysis framework to identify potential IO2BO vulnerabilities, and then uses backward slicing to find out related vulnerable arithmetic operations, and finally instruments programs with runtime checks. Moreover, IntPatch provides an interface for programmers who want to check integer overflows manually. We evaluated IntPatch on a few real-world applications. It caught all 46 previously known IO2BO vulnerabilities in our test suite and found 21 new bugs. Applications patched by IntPatch have negligible runtime performance losses which are on average 1%.