CWE-212 敏感数据的不恰当跨边界移除

admin 2021年12月16日16:31:12CWE(弱点枚举)评论41 views4764字阅读15分52秒阅读模式

CWE-212 敏感数据的不恰当跨边界移除

Improper Cross-boundary Removal of Sensitive Data

结构: Simple

Abstraction: Base

状态: Incomplete

被利用可能性: unkown

基本描述

The software uses a resource that contains sensitive data, but it does not properly remove that data before it stores, transfers, or shares the resource with actors in another control sphere.

扩展描述

Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.

For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.

相关缺陷

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

  • cwe_Nature: ChildOf cwe_CWE_ID: 669 cwe_View_ID: 1003 cwe_Ordinal: Primary

  • cwe_Nature: ChildOf cwe_CWE_ID: 200 cwe_View_ID: 699 cwe_Ordinal: Primary

  • cwe_Nature: ChildOf cwe_CWE_ID: 669 cwe_View_ID: 1000

适用平台

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

常见的影响

范围 影响 注释
Confidentiality ['Read Files or Directories', 'Read Application Data'] Sensitive data may be exposed to an unauthorized actor in another control sphere. This may have a wide range of secondary consequences which will depend on what data is exposed. One possibility is the exposure of system data allowing an attacker to craft a specific, more effective attack.

可能的缓解方案

Requirements

策略:

Clearly specify which information should be regarded as private or sensitive, and require that the product offers functionality that allows the user to cleanse the sensitive information from the resource before it is published or exported to other parties.

MIT-46 Architecture and Design

策略: Separation of Privilege

Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area.
Ensure that appropriate compartmentalization is built into the system design and that the compartmentalization serves to allow for and further reinforce privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide when it is appropriate to use and to drop system privileges.

MIT-33 Implementation

策略: Attack Surface Reduction

Use naming conventions and strong types to make it easier to spot when sensitive data is being used. When creating structures, objects, or other complex entities, separate the sensitive and non-sensitive data as much as possible.

Implementation

策略:

Avoid errors related to improper resource shutdown or release (CWE-404), which may leave the sensitive data within the resource if it is in an incomplete state.

示例代码

This code either generates a public HTML user information page or a JSON response containing the same user information.

bad PHP


// API flag, output JSON if set

$json = $_GET['json']
$username = $_GET['user']
if(!$json)
{

$record = getUserRecord($username);
foreach($record as $fieldName => $fieldValue)
{

if($fieldName == "email_address") {


// skip displaying user emails

continue;

}
else{

writeToHtmlPage($fieldName,$fieldValue);

}

}

}
else
{

$record = getUserRecord($username);
echo json_encode($record);

}

The programmer is careful to not display the user's e-mail address when displaying the public HTML page. However, the e-mail address is not removed from the JSON response, exposing the user's e-mail address.

分析过的案例

标识 说明 链接
CVE-2005-0406 Some image editors modify a JPEG image, but the original EXIF thumbnail image is left intact within the JPEG. (Also an interaction error). https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-0406
CVE-2002-0704 NAT feature in firewall leaks internal IP addresses in ICMP error messages. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2002-0704

Notes

Relationship
This entry is intended to be different from resultant information leaks, including those that occur from improper buffer initialization and reuse, improper encryption, interaction errors, and multiple interpretation errors. This entry could be regarded as a privacy leak, depending on the type of information that is leaked.
Relationship
There is a close association between CWE-226 and CWE-212. The difference is partially that of perspective. CWE-226 is geared towards the final stage of the resource lifecycle, in which the resource is deleted, eliminated, expired, or otherwise released for reuse. Technically, this involves a transfer to a different control sphere, in which the original contents of the resource are no longer relevant. CWE-212, however, is intended for sensitive data in resources that are intentionally shared with others, so they are still active. This distinction is useful from the perspective of the CWE research view (CWE-1000).
Terminology
The terms "cleansing" and "scrubbing" have multiple uses within computing. In information security, these are used for the removal of sensitive data, but they are also used for the modification of incoming/outgoing data so that it conforms to specifications.

分类映射

映射的分类名 ImNode ID Fit Mapped Node Name
PLOVER Cross-Boundary Cleansing Infoleak

相关攻击模式

  • CAPEC-168

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

特别标注: 本站(CN-SEC.COM)所有文章仅供技术研究,若将其信息做其他用途,由用户承担全部法律及连带责任,本站不承担任何法律及连带责任,请遵守中华人民共和国安全法.
  • 我的微信
  • 微信扫一扫
  • weinxin
  • 我的微信公众号
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年12月16日16:31:12
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                  CWE-212 敏感数据的不恰当跨边界移除 http://cn-sec.com/archives/612999.html

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: