CWE-733: Compiler Optimization Removal or Modification of Security-critical Code
CWE版本: 4.18
更新日期: 2025-09-09
弱点描述
The developer builds a security-critical protection mechanism into the software, but the compiler optimizes the program such that the mechanism is removed or modified.
常见后果
影响范围: Access Control Other
技术影响: Bypass Protection Mechanism Other
检测方法
方法: Black Box
This specific weakness is impossible to detect using black box methods. While an analyst could examine memory to see that it has not been scrubbed, an analysis of the executable would not be successful. This is because the compiler has already removed the relevant code. Only the source code shows whether the programmer intended to clear the memory or not, so this weakness is indistinguishable from others.
方法: White Box
This weakness is only detectable using white box methods (see black box detection factor). Careful analysis is required to determine if the code is likely to be removed by the compiler.
观察示例
参考: CVE-2008-1685
C compiler optimization, as allowed by specifications, removes code that is used to perform checks to detect integer overflows.
参考: CVE-2019-1010006
Chain: compiler optimization (CWE-733) removes or modifies code used to detect integer overflow (CWE-190), allowing out-of-bounds write (CWE-787).
适用平台
编程语言
关键信息
CWE ID: CWE-733
抽象级别: Base
结构: Simple
状态: Incomplete