CWE-252 - Unchecked Return Value
- 摘要:Base
- 结构:Simple
- 状态:Draft
- 发布日期:2006-07-19
- 更新日期:2025-12-11
名称
Unchecked Return Value
描述
The product does not check the return value from a method or function, which can prevent it from detecting unexpected states and conditions.
Two common programmer assumptions are "this function call can never fail" and "it doesn't matter if this function call fails". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the product is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.
常见后果
范围:Availability, Integrity
影响:Unexpected State, DoS: Crash, Exit, or Restart
注释:An unexpected return value could place the system in a state that could lead to a crash or other unintended behaviors.