The product uses a hard-coded, unchangeable cryptographic key.

Primary

Architecture and Design
REALIZATION: This weakness is caused during implementation of an architectural security tactic.

High

Access Control
Bypass Protection Mechanism
Gain Privileges or Assume Identity
Read Application Data
If hard-coded cryptographic keys are used, it is almost certain that malicious users will gain access through the account in question. The use of a hard-coded cryptographic key significantly increases the possibility that encrypted data may be recovered.

Automated Static Analysis
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.)
High

Architecture and Design
Prevention schemes mirror that of hard-coded password storage.

The following code examples attempt to verify a password using a hard-coded cryptographic key.

int VerifyAdmin(char *password) {
if (strcmp(password,"68af404b513073584c4b6f22b6c63e6b")) {

printf("Incorrect Password!\n");return(0);
}printf("Entering Diagnostic Mode...\n");return(1);
}

public boolean VerifyAdmin(String password) {if (password.equals("68af404b513073584c4b6f22b6c63e6b")) {System.out.println("Entering Diagnostic Mode...");return true;}System.out.println("Incorrect Password!");return false;

int VerifyAdmin(String password) {if (password.Equals("68af404b513073584c4b6f22b6c63e6b")) {Console.WriteLine("Entering Diagnostic Mode...");return(1);}Console.WriteLine("Incorrect Password!");return(0);}

The cryptographic key is within a hard-coded string value that is compared to the password. It is likely that an attacker will be able to read the key and compromise the system.

In 2022, the OT:ICEFALL study examined products by 10 different Operational Technology (OT) vendors. The researchers reported 56 vulnerabilities and said that the products were "insecure by design" [REF-1283]. If exploited, these vulnerabilities often allowed adversaries to change how the products operated, ranging from denial of service to changing the code that the products executed. Since these products were often used in industries such as power, electrical, water, and others, there could even be safety implications.
Multiple vendors used hard-coded keys for critical functionality in their OT products.

CVE-2022-29960
Engineering Workstation uses hard-coded cryptographic keys that could allow for unathorized filesystem access and privilege escalation
https://www.cve.org/CVERecord?id=CVE-2022-29960

CVE-2022-30271
Remote Terminal Unit (RTU) uses a hard-coded SSH private key that is likely to be used by default.
https://www.cve.org/CVERecord?id=CVE-2022-30271

CVE-2020-10884
WiFi router service has a hard-coded encryption key, allowing root access
https://www.cve.org/CVERecord?id=CVE-2020-10884

CVE-2014-2198
Communications / collaboration product has a hardcoded SSH private key, allowing access to root account
https://www.cve.org/CVERecord?id=CVE-2014-2198

Use of hard-coded cryptographic key

A8
Insecure Cryptographic Storage
CWE More Specific

A9
Insecure Communications
CWE More Specific

A8
Insecure Storage
CWE More Specific

SFP33
Hardcoded sensitive data

Part 2-4
Req SP.03.10 RE(1)

Part 2-4
Req SP.03.10 RE(3)

Part 3-3
Req SR 1.5

Part 3-3
Req SR 4.3

Part 4-1
Req SD-1

Part 4-2
Req SR 4.3

Part 4-2
Req CR 7.3

Allowed
This CWE entry is at the Variant 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.

The main difference between the use of hard-coded passwords and the use of hard-coded cryptographic keys is the false sense of security that the former conveys. Many people believe that simply hashing a hard-coded password before storage will protect the information from malicious users. However, many hashes are reversible (or at least vulnerable to brute force attacks) -- and further, many authentication protocols simply request the hash itself, making it no better than a password.

CLASP
2006-07-19
Draft 3
2006-07-19

Eric Dalci
Cigital
2008-07-01
updated Time_of_Introduction

Veracode
2008-08-15
Suggested OWASP Top Ten 2004 mapping

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

CWE Content Team
MITRE
2009-05-27
updated Demonstrative_Examples

CWE Content Team
MITRE
2010-02-16
updated Relationships

CWE Content Team
MITRE
2010-09-27
updated Relationships

CWE Content Team
MITRE
2010-12-13
updated Relationships

CWE Content Team
MITRE
2011-06-01
updated Common_Consequences

CWE Content Team
MITRE
2012-05-11
updated Demonstrative_Examples, Relationships

CWE Content Team
MITRE
2014-07-30
updated Demonstrative_Examples, Relationships, Taxonomy_Mappings

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

CWE Content Team
MITRE
2020-02-24
updated References, Relationships, Type

CWE Content Team
MITRE
2020-08-20
updated Relationships

CWE Content Team
MITRE
2020-12-10
updated Relationships

CWE Content Team
MITRE
2021-10-28
updated Relationships

CWE Content Team
MITRE
2022-10-13
updated Demonstrative_Examples, Observed_Examples, References

CWE Content Team
MITRE
2023-01-31
updated Applicable_Platforms, Maintenance_Notes, Taxonomy_Mappings

CWE Content Team
MITRE
2023-04-27
updated Detection_Factors, Relationships, Taxonomy_Mappings

CWE Content Team
MITRE
2023-06-29
updated Mapping_Notes, Taxonomy_Mappings

CWE Content Team
MITRE
2025-04-03
4.17
2025-04-03
updated Common_Consequences, Description, Diagram

CWE Content Team
MITRE
2025-12-11
4.19
2025-12-11
updated Maintenance_Notes, Relationships, Weakness_Ordinalities

"Mapping CWE to 62443" Sub-Working Group
CWE-CAPEC ICS/OT SIG
2023-01-24
4.10
2023-01-31
Suggested mappings to ISA/IEC 62443.

"Mapping CWE to 62443" Sub-Working Group
CWE-CAPEC ICS/OT SIG
2023-04-25
Suggested mappings to ISA/IEC 62443.