Skip to main content

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

BaseIncomplete

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.

View on MITRE
Back to CWE Lookup

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.

Technical Details

Structure
Simple

Applicable To

Languages
Not Language-Specific
Platforms

Frequently Asked Questions

What is CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer?+

CWE-212: Improper Removal of Sensitive Information Before Storage or Transfer is a Common Weakness Enumeration (CWE) entry maintained by MITRE. 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.

What are the security consequences of Improper Removal of Sensitive Information Before Storage or Transfer?+

If exploited, CWE-212 (Improper Removal of Sensitive Information Before Storage or Transfer) it can compromise Confidentiality, leading to outcomes such as Read Files or Directories and Read Application Data.

How do you prevent or mitigate Improper Removal of Sensitive Information Before Storage or Transfer?+

Recommended mitigations for CWE-212 include: 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. 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.

Which programming languages are affected by Improper Removal of Sensitive Information Before Storage or Transfer?+

CWE-212 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Improper Removal of Sensitive Information Before Storage or Transfer?+

MITRE documents real CVEs mapped to CWE-212, including CVE-2019-3733, CVE-2005-0406 and CVE-2002-0704. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-212 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More