CWE-312: Cleartext Storage of Sensitive Information (Base)

Description: The product stores sensitive information in cleartext within a resource that might be accessible to another control sphere.

Extended Description: Because the information is stored in cleartext (i.e., unencrypted), attackers could potentially read it. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information. When organizations adopt cloud services, it can be easier for attackers to access the data from anywhere on the Internet. In some systems/environments such as cloud, the use of double encryption (at both the software and hardware layer) might be required, and the developer might be solely responsible for both layers, instead of shared responsibility with the administrator of the broader system/environment.



Applicable Platforms: ::LANGUAGE CLASS:Not Language-Specific:LANGUAGE PREVALENCE:Undetermined::TECHNOLOGY CLASS:Cloud Computing:TECHNOLOGY PREVALENCE:Undetermined::TECHNOLOGY CLASS:ICS/OT:TECHNOLOGY PREVALENCE:Undetermined::TECHNOLOGY CLASS:Mobile:TECHNOLOGY PREVALENCE:Undetermined::

Modes of Introduction: ::PHASE:Architecture and Design:NOTE:OMISSION: This weakness is caused by missing a security tactic during the architecture and design phase.::



Common Consequences: ::SCOPE:Confidentiality:IMPACT:Read Application Data:NOTE:An attacker with access to the system could read sensitive information stored in cleartext.::

Detection Methods: ::METHOD:Automated Static Analysis:DESCRIPTION:Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect sources (origins of input) with sinks (destinations where the data interacts with external components, a lower layer such as the OS, etc.):EFFECTIVENESS:High::

Potential Mitigations: ::PHASE:Implementation System Configuration Operation:DESCRIPTION:When storing data in the cloud (e.g., S3 buckets, Azure blobs, Google Cloud Storage, etc.), use the provider's controls to encrypt the data at rest. [REF-1297] [REF-1299] [REF-1301]::

Observed Examples: ::REFERENCE:CVE-2022-30275:DESCRIPTION:Remote Terminal Unit (RTU) uses a driver that relies on a password stored in plaintext.:LINK:https://www.cve.org/CVERecord?id=CVE-2022-30275::REFERENCE:CVE-2009-2272:DESCRIPTION:password and username stored in cleartext in a cookie:LINK:https://www.cve.org/CVERecord?id=CVE-2009-2272::REFERENCE:CVE-2009-1466:DESCRIPTION:password stored in cleartext in a file with insecure permissions:LINK:https://www.cve.org/CVERecord?id=CVE-2009-1466::REFERENCE:CVE-2009-0152:DESCRIPTION:chat program disables SSL in some circumstances even when the user says to use SSL.:LINK:https://www.cve.org/CVERecord?id=CVE-2009-0152::REFERENCE:CVE-2009-1603:DESCRIPTION:Chain: product uses an incorrect public exponent when generating an RSA key, which effectively disables the encryption:LINK:https://www.cve.org/CVERecord?id=CVE-2009-1603::REFERENCE:CVE-2009-0964:DESCRIPTION:storage of unencrypted passwords in a database:LINK:https://www.cve.org/CVERecord?id=CVE-2009-0964::REFERENCE:CVE-2008-6157:DESCRIPTION:storage of unencrypted passwords in a database:LINK:https://www.cve.org/CVERecord?id=CVE-2008-6157::REFERENCE:CVE-2008-6828:DESCRIPTION:product stores a password in cleartext in memory:LINK:https://www.cve.org/CVERecord?id=CVE-2008-6828::REFERENCE:CVE-2008-1567:DESCRIPTION:storage of a secret key in cleartext in a temporary file:LINK:https://www.cve.org/CVERecord?id=CVE-2008-1567::REFERENCE:CVE-2008-0174:DESCRIPTION:SCADA product uses HTTP Basic Authentication, which is not encrypted:LINK:https://www.cve.org/CVERecord?id=CVE-2008-0174::REFERENCE:CVE-2007-5778:DESCRIPTION:login credentials stored unencrypted in a registry key:LINK:https://www.cve.org/CVERecord?id=CVE-2007-5778::REFERENCE:CVE-2001-1481:DESCRIPTION:Plaintext credentials in world-readable file.:LINK:https://www.cve.org/CVERecord?id=CVE-2001-1481::REFERENCE:CVE-2005-1828:DESCRIPTION:Password in cleartext in config file.:LINK:https://www.cve.org/CVERecord?id=CVE-2005-1828::REFERENCE:CVE-2005-2209:DESCRIPTION:Password in cleartext in config file.:LINK:https://www.cve.org/CVERecord?id=CVE-2005-2209::REFERENCE:CVE-2002-1696:DESCRIPTION:Decrypted copy of a message written to disk given a combination of options and when user replies to an encrypted message.:LINK:https://www.cve.org/CVERecord?id=CVE-2002-1696::REFERENCE:CVE-2004-2397:DESCRIPTION:Plaintext storage of private key and passphrase in log file when user imports the key.:LINK:https://www.cve.org/CVERecord?id=CVE-2004-2397::REFERENCE:CVE-2002-1800:DESCRIPTION:Admin password in plaintext in a cookie.:LINK:https://www.cve.org/CVERecord?id=CVE-2002-1800::REFERENCE:CVE-2001-1537:DESCRIPTION:Default configuration has cleartext usernames/passwords in cookie.:LINK:https://www.cve.org/CVERecord?id=CVE-2001-1537::REFERENCE:CVE-2001-1536:DESCRIPTION:Usernames/passwords in cleartext in cookies.:LINK:https://www.cve.org/CVERecord?id=CVE-2001-1536::REFERENCE:CVE-2005-2160:DESCRIPTION:Authentication information stored in cleartext in a cookie.:LINK:https://www.cve.org/CVERecord?id=CVE-2005-2160::



Notes: ::TYPE:Terminology:NOTE:Different people use cleartext and plaintext to mean the same thing: the lack of encryption. However, within cryptography, these have more precise meanings. Plaintext is the information just before it is fed into a cryptographic algorithm, including already-encrypted text. Cleartext is any information that is unencrypted, although it might be in an encoded form that is not easily human-readable (such as base64 encoding).::