安全研究员Chris Domas在Black Hat USA 2026会议上指出,编译器的合法优化操作可能会移除安全保护、删除内存清理代码,甚至在表面安全的代码中引入时间检查到使用的漏洞1。这一发现表明,即使开发者严格遵循最佳实践编写安全的C代码,最终生成的二进制文件仍然可能存在漏洞1。
Domas的研究通过分析500万行开源代码,识别出300个潜在危险的编码模式1。他的分析揭示了一个令人担忧的现象:二进制文件是否易受攻击与多个因素相关,包括寄存器压力、结构布局和数据大小1。研究发现,在某些情况下,17字节或33字节的代码可能是安全的,但其他大小的代码则会产生易受攻击的版本1。
为应对这一风险,Domas建议开发者采取多项措施:启用编译器警告、使用Sanitizer工具、分析优化后的构建过程,以及对最终要部署的二进制文件进行充分测试1。
Security researcher Chris Domas revealed at Black Hat USA 2026 that legitimate compiler optimizations can strip away security protections, remove memory cleanup operations, and introduce use-after-free vulnerabilities in seemingly secure code.1 The research analyzed five million lines of open-source code and identified 300 potentially dangerous patterns, demonstrating that even code written according to best practices can result in vulnerable binaries after compilation.1
Domas found that factors such as register pressure, structure layout, and data size determine whether compiled binaries become vulnerable to attack.1 The research uncovered specific cases where certain binary sizes—such as 17 or 33 bytes—remain secure, while other sizes produce exploitable code.1
To mitigate these risks, developers should enable compiler warnings, use Sanitizer tools, analyze optimized builds, and test the final binaries that will be deployed in production.1
评论
还没有评论,欢迎留下第一条。