CWE-455 初始化失效后的不存在变量

Non-exit on Failed Initialization

结构: Simple

Abstraction: Base

状态: Draft

被利用可能性: unkown

基本描述

The software does not exit or otherwise modify its operation when security-relevant errors occur during initialization, such as when a configuration file has a format error, which can cause the software to execute in a less secure fashion than intended by the administrator.

相关缺陷

  • cwe_Nature: ChildOf cwe_CWE_ID: 665 cwe_View_ID: 1000

  • cwe_Nature: ChildOf cwe_CWE_ID: 705 cwe_View_ID: 1000 cwe_Ordinal: Primary

  • cwe_Nature: ChildOf cwe_CWE_ID: 636 cwe_View_ID: 1000

适用平台

Language: {'cwe_Class': 'Language-Independent', 'cwe_Prevalence': 'Undetermined'}

常见的影响

范围 影响 注释
['Integrity', 'Other'] ['Modify Application Data', 'Alter Execution Logic'] The application could be placed in an insecure state that may allow an attacker to modify sensitive data or allow unintended logic to be executed.

可能的缓解方案

Implementation

策略:

Follow the principle of failing securely when an error occurs. The system should enter a state where it is not vulnerable and will not display sensitive error messages to a potential attacker.

示例代码

The following code intends to limit certain operations to the administrator only.

bad Perl

$username = GetCurrentUser();
$state = GetStateData($username);
if (defined($state)) {
$uid = ExtractUserID($state);
}

# do stuff

if ($uid == 0) {
DoAdminThings();
}

If the application is unable to extract the state information - say, due to a database timeout - then the $uid variable will not be explicitly set by the programmer. This will cause $uid to be regarded as equivalent to "0" in the conditional, allowing the original user to perform administrator actions. Even if the attacker cannot directly influence the state data, unexpected errors could cause incorrect privileges to be assigned to a user just by accident.

分析过的案例

标识 说明 链接

Notes

分类映射

映射的分类名 ImNode ID Fit Mapped Node Name
PLOVER Non-exit on Failed Initialization