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.

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.

Primary

Resultant

Architecture and Design

Implementation
REALIZATION: This weakness is caused during implementation of an architectural security tactic.

Operation

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 that will depend on
what data is exposed. One possibility is the exposure
of system data - such as file locations, software
versions, or device data - that allow an attacker to
craft a specific, more effective attack. Alternately,
insufficient redaction of Private Personal Information
(PPI), Personally Identifiable Information (PII), or
other types of information might not harm the secure
operation of the product itself, but could be
violations of expectations by the product's
users.

Automated Static Analysis
Tools are available to analyze documents
(such as PDF, Word, etc.) to look for private information
such as names, addresses, etc.

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.

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 the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.

Implementation
Operation
Attack Surface Reduction

Some tools can automatically analyze
documents to redact, strip, or "sanitize" private
information, although some human review might be
necessary. Tools may vary in terms of which document
formats can be processed.

When calling an external program to automatically
generate or convert documents, invoke the program with
any available options that avoid generating sensitive
metadata. Some formats have well-defined fields that
could contain private data, such as Exchangeable image
file format (Exif), which can contain potentially
sensitive metadata such as geolocation, date, and time
[REF-1515] [REF-1516].

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.
Defense in Depth
This makes it easier to spot places in the code where data is being used that is unencrypted.

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.

// 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-2020-26220
Customer relationship management (CRM) product does not strip Exif data from images
https://www.cve.org/CVERecord?id=CVE-2020-26220

CVE-2019-3733
Cryptography library does not clear heap memory before release
https://www.cve.org/CVERecord?id=CVE-2019-3733

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://www.cve.org/CVERecord?id=CVE-2005-0406

CVE-2002-0704
NAT feature in firewall leaks internal IP addresses in ICMP error messages.
https://www.cve.org/CVERecord?id=CVE-2002-0704

Cross-Boundary Cleansing Infoleak

Allowed
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

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.
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).
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.

PLOVER
2006-07-19
Draft 3
2006-07-19

Eric Dalci
Cigital
2008-07-01
updated Time_of_Introduction

CWE Content Team
MITRE
2008-09-08
updated Relationships, Other_Notes, Taxonomy_Mappings

CWE Content Team
MITRE
2008-10-14
updated Description

CWE Content Team
MITRE
2009-10-29
updated Description, Other_Notes, Relationship_Notes

CWE Content Team
MITRE
2009-12-28
updated Name

CWE Content Team
MITRE
2010-02-16
updated Applicable_Platforms, Common_Consequences, Description, Name, Observed_Examples, Potential_Mitigations, Relationship_Notes, Relationships, Terminology_Notes

CWE Content Team
MITRE
2010-04-05
updated Related_Attack_Patterns

CWE Content Team
MITRE
2010-06-21
updated Potential_Mitigations

CWE Content Team
MITRE
2010-09-27
updated Potential_Mitigations

CWE Content Team
MITRE
2011-06-01
updated Common_Consequences

CWE Content Team
MITRE
2011-06-27
updated Demonstrative_Examples, Relationships

CWE Content Team
MITRE
2012-05-11
updated Relationships

CWE Content Team
MITRE
2012-10-30
updated Potential_Mitigations

CWE Content Team
MITRE
2014-07-30
updated Relationships

CWE Content Team
MITRE
2017-11-08
updated Modes_of_Introduction, Relationships

CWE Content Team
MITRE
2019-06-20
updated Relationships

CWE Content Team
MITRE
2020-02-24
updated Description, Name, Relationships, Weakness_Ordinalities

CWE Content Team
MITRE
2020-06-25
updated Relationships

CWE Content Team
MITRE
2020-12-10
updated Potential_Mitigations

CWE Content Team
MITRE
2023-01-31
updated Description

CWE Content Team
MITRE
2023-04-27
updated Relationships

CWE Content Team
MITRE
2023-06-29
updated Mapping_Notes

CWE Content Team
MITRE
2024-02-29
4.14
2024-02-29
updated Demonstrative_Examples, Observed_Examples

CWE Content Team
MITRE
2025-12-11
4.19
2025-12-11
updated Common_Consequences, Detection_Factors, Observed_Examples, Potential_Mitigations, References

Michal Biesiada
2023-02-08
4.19
2025-12-11
suggested covering PPI in documents such as PDFs

Michal Biesiada
2023-03-29
4.19
2025-12-11
suggested covering Exif in images

Cross-boundary Cleansing Information Leak
Improper Cross-boundary Cleansing
Improper Cross-boundary Removal of Sensitive Data