CWE-14: Compiler Removal of Code to Clear Buffers
low-riskSensitive memory is cleared according to the source code, but compiler optimizations leave the memory untouched when it is not read from again, aka "dead store removal."
Common Consequences
Detection Methods
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.
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.
Real-World Examples (9)
| CVE | CVSS | EPSS | KEV |
|---|---|---|---|
| CVE-2023-32100 | 5.3 | 0.2% | — |
| CVE-2023-32098 | 5.3 | 0.2% | — |
| CVE-2023-32096 | 3.1 | 0.1% | — |
| CVE-2023-2481 | 5.3 | 0.1% | — |
| CVE-2023-32099 | 5.3 | 0.1% | — |
| CVE-2023-32097 | 3.1 | 0.1% | — |
| CVE-2023-1132 | 5.3 | 0.1% | — |
| CVE-2023-0965 | 3.1 | 0.1% | — |
| CVE-2025-64646 | 6.2 | 0.0% | — |