Description
The product does not encrypt sensitive or critical information before storage or transmission.
Potential Impact
Confidentiality
Read Application Data
Confidentiality, Integrity
Modify Application Data
Demonstrative Examples
function persistLogin($username, $password){$data = array("username" => $username, "password"=> $password);setcookie ("userdata", $data);}server.sin_family = AF_INET; hp = gethostbyname(argv[1]);if (hp==NULL) error("Unknown host");memcpy( (char *)&server.sin_addr,(char *)hp->h_addr,hp->h_length);if (argc < 3) port = 80;else port = (unsigned short)atoi(argv[3]);server.sin_port = htons(port);if (connect(sock, (struct sockaddr *)&server, sizeof server) < 0) error("Connecting");...while ((n=read(sock,buffer,BUFSIZE-1))!=-1) {
write(dfd,password_buffer,n);...try {URL u = new URL("http://www.secret.example.org/");HttpURLConnection hu = (HttpURLConnection) u.openConnection();hu.setRequestMethod("PUT");hu.connect();OutputStream os = hu.getOutputStream();hu.disconnect();}catch (IOException e) {
//...
}Mitigations & Prevention
Clearly specify which data or resources are valuable enough that they should be protected by encryption. Require that any transmission or storage of this data/resource should use well-vetted encryption algorithms.
Ensure that encryption is properly integrated into the system design, including but not necessarily limited to: Identify the separate needs and contexts for encryption: Using threat modeling or other techniques, assume that data can be compromised through a separate vulnerability or weakness, and determine where encryption will be most effective. Ensure that d
When there is a need to store or transmit sensitive data, use strong, up-to-date cryptographic algorithms to encrypt that data. Select a well-vetted algorithm that is currently considered to be strong by experts in the field, and use well-tested implementations. As with all cryptographic mechanisms, the source code should be available for analysis. For example, US government systems require FIPS 140-2 certification. Do not develop custom or private cryptog
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
When using industry-approved techniques, use them correctly. Don't cut corners by skipping resource-intensive steps (CWE-325). These steps are often essential for preventing common attacks.
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.
Detection Methods
- Manual Analysis High — The characterizaton of sensitive data often requires domain-specific understanding, so manual methods are useful. However, manual efforts might not achieve desired code coverage within limited time constraints. Black box methods may produce artifacts (e.g. stored data or unencrypted network transfer
- Automated Analysis — Automated measurement of the entropy of an input/output source may indicate the use or lack of encryption, but human analysis is still required to distinguish intentionally-unencrypted data (e.g. metadata) from sensitive data.
- Manual Static Analysis - Binary or Bytecode SOAR Partial — According to SOAR [REF-1479], the following detection techniques may be useful:
- Dynamic Analysis with Automated Results Interpretation SOAR Partial — According to SOAR [REF-1479], the following detection techniques may be useful:
- Dynamic Analysis with Manual Results Interpretation High — According to SOAR [REF-1479], the following detection techniques may be useful:
- Manual Static Analysis - Source Code High — According to SOAR [REF-1479], the following detection techniques may be useful:
Real-World CVE Examples
| CVE ID | Description |
|---|---|
| CVE-2022-26390 | wireless battery product stores credentials and Personal Health Information (PHI) without encryption |
| CVE-2009-2272 | password and username stored in cleartext in a cookie |
| CVE-2009-1466 | password stored in cleartext in a file with insecure permissions |
| CVE-2009-0152 | chat program disables SSL in some circumstances even when the user says to use SSL. |
| CVE-2009-1603 | Chain: product uses an incorrect public exponent when generating an RSA key, which effectively disables the encryption |
| CVE-2009-0964 | storage of unencrypted passwords in a database |
| CVE-2008-6157 | storage of unencrypted passwords in a database |
| CVE-2008-6828 | product stores a password in cleartext in memory |
| CVE-2008-1567 | storage of a secret key in cleartext in a temporary file |
| CVE-2008-0174 | SCADA product uses HTTP Basic Authentication, which is not encrypted |
| CVE-2007-5778 | login credentials stored unencrypted in a registry key |
| CVE-2002-1949 | Passwords transmitted in cleartext. |
| CVE-2008-4122 | Chain: Use of HTTPS cookie without "secure" flag causes it to be transmitted across unencrypted HTTP. |
| CVE-2008-3289 | Product sends password hash in cleartext in violation of intended policy. |
| CVE-2008-4390 | Remote management feature sends sensitive information including passwords in cleartext. |
Showing 15 of 21 observed examples.
Related Weaknesses
Taxonomy Mappings
- CLASP: — Failure to encrypt data
- OWASP Top Ten 2007: A8 — Insecure Cryptographic Storage
- OWASP Top Ten 2007: A9 — Insecure Communications
- OWASP Top Ten 2004: A8 — Insecure Storage
- WASC: 4 — Insufficient Transport Layer Protection
- The CERT Oracle Secure Coding Standard for Java (2011): MSC00-J — Use SSLSocket rather than Socket for secure data exchange
- Software Fault Patterns: SFP23 — Exposed Data
- ISA/IEC 62443: Part 3-3 — Req SR 4.1
- ISA/IEC 62443: Part 3-3 — Req SR 4.3
- ISA/IEC 62443: Part 4-2 — Req CR 4.1
- ISA/IEC 62443: Part 4-2 — Req CR 7.3
- ISA/IEC 62443: Part 4-2 — Req CR 1.5
Frequently Asked Questions
What is CWE-311?
CWE-311 (Missing Encryption of Sensitive Data) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Class-level weakness. The product does not encrypt sensitive or critical information before storage or transmission.
How can CWE-311 be exploited?
Attackers can exploit CWE-311 (Missing Encryption of Sensitive Data) to read application data. This weakness is typically introduced during the Architecture and Design, Operation phase of software development.
How do I prevent CWE-311?
Key mitigations include: Clearly specify which data or resources are valuable enough that they should be protected by encryption. Require that any transmission or storage of this data/resource should use well-vetted encryptio
What is the severity of CWE-311?
CWE-311 is classified as a Class-level weakness (High abstraction). It has been observed in 21 real-world CVEs.