CWE-321: Use of Hard-coded Cryptographic Key

What is CWE-321?

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

Analyzing data...

Data statistics

OWASP TOP 10:2025 RANK4 — A04:2025 — Cryptographic Failures
RELATED CVES (365 DAYS)84
ABSTRACTIONVariant
LIKELIHOOD OF EXPLOITHigh

Vulnerabilities mapped to CWE-321

84 vulnerabilities366.7% increase year over year

Vulnerabilities in CISA KEV for CWE-321

0 vulnerabilities

Official definition

ByMitre CWE

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

Characteristics

Modes of introduction

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

Common consequences

ImpactScopeExplanation
Bypass Protection Mechanism, Gain Privileges or Assume Identity, Read Application DataAccess ControlIf 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.

Risk mitigations

  1. Architecture and DesignPrevention schemes mirror that of hard-coded password storage.

Detection methods

MethodApproachEffectiveness
Automated Static AnalysisAutomated 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

Representative vulnerabilities

Sources (4)

CWE™ Program, operated by The MITRE Corporation. Copyright © 2006–2026, The MITRE Corporation. The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. CWE Terms of Use.

Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.

Explore CyStack VulnScan