CWE-758: Reliance on Undefined, Unspecified, or Implementation-Defined Behavior
CWE版本: 4.18
更新日期: 2025-09-09
弱点描述
The product uses an API function, data structure, or other entity in a way that relies on properties that are not always guaranteed to hold for that entity.
扩展描述
This can lead to resultant weaknesses when the required properties change, such as when the product is ported to a different platform or if an interaction error (CWE-435) occurs.
常见后果
影响范围: Other
技术影响: Other
检测方法
方法: Fuzzing
Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues.
有效性: High
观察示例
参考: CVE-2006-1902
Change in C compiler behavior causes resultant buffer overflows in programs that depend on behaviors that were undefined in the C standard.
分类映射
| 分类名称 | 条目ID | 条目名称 | 映射适配度 |
|---|---|---|---|
| CERT C Secure Coding | ARR32-C | Ensure size arguments for variable length arrays are in a valid range | CWE More Abstract |
| CERT C Secure Coding | ERR34-C | Detect errors when converting a string to a number | Imprecise |
| CERT C Secure Coding | EXP30-C | Do not depend on the order of evaluation for side effects | CWE More Abstract |
| CERT C Secure Coding | EXP33-C | Do not read uninitialized memory | CWE More Abstract |
| CERT C Secure Coding | FIO46-C | Do not access a closed file | CWE More Abstract |
| CERT C Secure Coding | INT34-C | Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand | CWE More Abstract |
| CERT C Secure Coding | INT36-C | Converting a pointer to integer or integer to pointer | CWE More Abstract |
| CERT C Secure Coding | MEM30-C | Do not access freed memory | CWE More Abstract |
| CERT C Secure Coding | MSC14-C | Do not introduce unnecessary platform dependencies | - |
| CERT C Secure Coding | MSC15-C | Do not depend on undefined behavior | - |
| CERT C Secure Coding | MSC37-C | Ensure that control never reaches the end of a non-void function | CWE More Abstract |