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

admin 2021年12月12日05:47:11评论62 views字数 1678阅读5分35秒阅读模式

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

文章来源于互联网:scap中文网

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年12月12日05:47:11
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CWE-455 初始化失效后的不存在变量http://cn-sec.com/archives/613263.html

发表评论

匿名网友 填写信息