CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer

Description

The product stores, transfers, or shares a resource that contains sensitive information, but it does not properly remove that information before the product makes the resource available to unauthorized actors.

Submission Date :

July 19, 2006, midnight

Modification Date :

2023-06-29 00:00:00+00:00

Organization :

MITRE
Extended Description

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, a product 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.

Example Vulnerable Codes

Example - 1

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


// // API flag, output JSON if set// 


// // skip displaying user emails// 
continue;
writeToHtmlPage($fieldName,$fieldValue);if($fieldName == "email_address") {}else{}$record = getUserRecord($username);foreach($record as $fieldName => $fieldValue){}

$record = getUserRecord($username);echo json_encode($record);$json = $_GET['json']$username = $_GET['user']if(!$json){}else{}

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.

Related Weaknesses

This table shows the weaknesses and high level categories that are related to this weakness. These relationships are defined to give an overview of the different insight to similar items that may exist at higher and lower levels of abstraction.

Visit http://cwe.mitre.org/ for more details.

© cvefeed.io
Latest DB Update: Dec. 22, 2024 5:12