Chi tiết CWE-14

CWE-14

Compiler Removal of Code to Clear Buffers
2006-07-19
00h00 +00:00
Draft
2026-10-28
00h00 +00:00
Thông báo cho một CWE
Luôn được thông báo về mọi thay đổi đối với một CWE cụ thể.
Quản lý thông báo

Tên: Compiler Removal of Code to Clear Buffers

Sensitive 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."

Thông tin chung

Các cách xuất hiện

Array
Build and Compilation

Nền tảng áp dụng

Ngôn ngữ

Tên: C (Undetermined)
Tên: C++ (Undetermined)
Lớp: Compiled (Undetermined)

Kiến trúc

Lớp: Not Architecture-Specific (Undetermined)

Hậu quả phổ biến

Phạm vi Tác động Khả năng xảy ra
Confidentiality
Access Control
Read Memory, Bypass Protection Mechanism

Ghi chú: This weakness will allow data that has not been cleared from memory to be read. If this data contains sensitive password information, then an attacker can read the password and use the information to bypass protection mechanisms.

Các biện pháp giảm thiểu tiềm năng

Phases : Implementation
Store the sensitive data in a "volatile" memory location if available.
Phases : Build and Compilation
If possible, configure the compiler so that it does not remove dead stores.
Phases : Architecture and Design
Where possible, encrypt sensitive data that are used by a software system.

Phương pháp phát hiện

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.
Hiệu quả : Limited

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.

Ghi chú ánh xạ lỗ hổng

Lý do : This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Bình luận : Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

Tài liệu tham khảo

REF-6

Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors
Katrina Tsipenyuk, Brian Chess, Gary McGraw.
https://cwe.mitre.org/documents/sources/SevenPerniciousKingdoms.pdf

REF-7

Writing Secure Code
Michael Howard, David LeBlanc.
https://www.microsoftpressstore.com/store/writing-secure-code-9780735617223

REF-124

When scrubbing secrets in memory doesn't work
Michael Howard.
https://seclists.org/bugtraq/2002/Nov/48

REF-125

Some Bad News and Some Good News
Michael Howard.
https://learn.microsoft.com/en-us/previous-versions/ms972826(v=msdn.10)

REF-126

GNU GCC: Optimizer Removes Code Necessary for Security
Joseph Wagner.
https://seclists.org/bugtraq/2002/Nov/266

Gửi

Tên Tổ chức Ngày Ngày phát hành Version
7 Pernicious Kingdoms 2006-07-19 +00:00 2006-07-19 +00:00 Draft 3

Sửa đổi

Tên Tổ chức Ngày Bình luận
Eric Dalci Cigital 2008-07-01 +00:00 updated Time_of_Introduction
CWE Content Team MITRE 2008-09-08 +00:00 updated Relationships, Other_Notes, Taxonomy_Mappings
CWE Content Team MITRE 2008-10-14 +00:00 updated Relationships
CWE Content Team MITRE 2008-11-24 +00:00 updated Applicable_Platforms, Description, Detection_Factors, Other_Notes, Potential_Mitigations, Relationships, Taxonomy_Mappings, Time_of_Introduction
CWE Content Team MITRE 2009-05-27 +00:00 updated Demonstrative_Examples
CWE Content Team MITRE 2010-02-16 +00:00 updated References
CWE Content Team MITRE 2011-06-01 +00:00 updated Common_Consequences
CWE Content Team MITRE 2011-09-13 +00:00 updated Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2012-05-11 +00:00 updated Common_Consequences, References, Relationships
CWE Content Team MITRE 2014-07-30 +00:00 updated Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2017-01-19 +00:00 updated Relationships
CWE Content Team MITRE 2017-11-08 +00:00 updated References, Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2018-03-27 +00:00 updated References, Type
CWE Content Team MITRE 2020-02-24 +00:00 updated References, Relationships
CWE Content Team MITRE 2023-04-27 +00:00 updated References, Relationships
CWE Content Team MITRE 2023-06-29 +00:00 updated Mapping_Notes
CWE Content Team MITRE 2024-02-29 +00:00 updated Demonstrative_Examples, Description
CWE Content Team MITRE 2025-09-09 +00:00 updated References
CWE Content Team MITRE 2025-12-11 +00:00 updated Applicable_Platforms, Demonstrative_Examples, Detection_Factors, Weakness_Ordinalities
CWE Content Team MITRE 2026-10-28 +00:00 updated Description, Modes_of_Introduction, Potential_Mitigations, References