CWE-321: Use of Hard-coded Cryptographic Key

VariantDraftExploit Likelihood: High

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

View on MITRE
Back to CWE Lookup

Technical Details

Structure
Simple

Applicable To

Languages
Not Language-Specific
Platforms

Frequently Asked Questions

What is CWE-321: Use of Hard-coded Cryptographic Key?+

CWE-321: Use of Hard-coded Cryptographic Key is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product uses a hard-coded, unchangeable cryptographic key.

What are the security consequences of Use of Hard-coded Cryptographic Key?+

If exploited, CWE-321 (Use of Hard-coded Cryptographic Key) it can compromise Access Control, leading to outcomes such as Bypass Protection Mechanism, Gain Privileges or Assume Identity and Read Application Data.

How do you prevent or mitigate Use of Hard-coded Cryptographic Key?+

Recommended mitigations for CWE-321 include: Prevention schemes mirror that of hard-coded password storage.

Which programming languages are affected by Use of Hard-coded Cryptographic Key?+

CWE-321 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 Use of Hard-coded Cryptographic Key?+

MITRE documents real CVEs mapped to CWE-321, including CVE-2022-29960, CVE-2022-30271, CVE-2020-10884 and CVE-2014-2198. 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-321 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