Compiler Can Undo Your Security Checks
Chris Domas explains at Black Hat how legal compiler optimizations can strip security checks and memory-clearing operations, turning secure C source into vulnerable binaries.
David Bombal interviews researcher Chris Domas at Black Hat USA 2026 about how the C abstract machine permits compilers to legally transform code in ways that remove security protections, delete memory-clearing operations, and introduce time-of-check to time-of-use vulnerabilities. Factors like register pressure, structure layout, and data size affect vulnerability, with examples where 17 or 33 byte buffers are safe while nearby sizes produce vulnerable code. An AI-assisted analysis of 500 million lines of open-source code identified 300 potentially dangerous patterns. Recommended mitigations include enabling compiler warnings, using sanitizers, analyzing optimized builds, and testing the exact binary that ships.