%0 Journal Article %A Coker, Zack %A Hasan, Samir %A Overbey, Jeffrey %A Hafiz, Munawar %A Kästner, Christian %D 2014 %T Integers In C: An Open Invitation To Security Attacks? %U https://kilthub.cmu.edu/articles/journal_contribution/Integers_In_C_An_Open_Invitation_To_Security_Attacks_/6622550 %R 10.1184/R1/6622550.v1 %2 https://kilthub.cmu.edu/ndownloader/files/12119057 %K C language %K C Preprocessor %K Integer Issues %K Safe C standard %X

We performed an empirical study to explore how closely well-known, open source C programs follow the safe C standards for integer behavior, with the goal of understanding how difficult it is to migrate legacy code to these stricter standards. We performed an automated analysis on fifty-two releases of seven C programs (6 million lines of preprocessed C code), as well as releases of Busybox and Linux (nearly one billion lines of partially-preprocessed C code). We found that integer issues, that are allowed by the C standard but not by the safer C standards, are ubiquitous—one out of four integers were inconsistently declared, and one out of eight integers were inconsistently used. Integer issues did not improve over time as the programs evolved. Also, detecting the issues is complicated by a large number of integers whose types vary under different preprocessor configurations. Most of these issues are benign, but the chance of finding fatal errors and exploitable vulnerabilities among these many issues remains significant. A preprocessor-aware, tool-assisted approach may be the most viable way to migrate legacy C code to comply with the standards for secure programming.

%I Carnegie Mellon University