Common Weakness Enumeration

CWE-321

Weakness Allowed

Use of Hard-coded Cryptographic Key

Abstraction: Variant · Status: Draft

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

Mapping guidance

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.

Relationships and members
ChildOf: CWE-798 · View CWE-1000
ChildOf: CWE-798 · View CWE-1305
ChildOf: CWE-798 · View CWE-1340
Modes of introduction
Architecture and Design

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

Detection methods

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.)

Effectiveness: High

Notes

Other

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.

Content history
Submission: CLASP · 2006-07-19 · CWE Draft 3
Contribution: "Mapping CWE to 62443" Sub-Working Group · CWE-CAPEC ICS/OT SIG · 2023-01-24 · CWE 4.10

Suggested mappings to ISA/IEC 62443.

Contribution: "Mapping CWE to 62443" Sub-Working Group · CWE-CAPEC ICS/OT SIG · 2023-04-25 · CWE 4.11

Suggested mappings to ISA/IEC 62443.

Modification: Eric Dalci · Cigital · 2008-07-01 · CWE 1.0

updated Time_of_Introduction

Modification: · Veracode · 2008-08-15 · CWE 1.0

Suggested OWASP Top Ten 2004 mapping

Modification: CWE Content Team · MITRE · 2008-09-08 · CWE 1.0

updated Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2009-05-27 · CWE 1.4

updated Demonstrative_Examples

Modification: CWE Content Team · MITRE · 2010-02-16 · CWE 1.8

updated Relationships

Modification: CWE Content Team · MITRE · 2010-09-27 · CWE 1.10

updated Relationships

Modification: CWE Content Team · MITRE · 2010-12-13 · CWE 1.11

updated Relationships

Modification: CWE Content Team · MITRE · 2011-06-01 · CWE 1.13

updated Common_Consequences

Modification: CWE Content Team · MITRE · 2012-05-11 · CWE 2.2

updated Demonstrative_Examples, Relationships

Modification: CWE Content Team · MITRE · 2014-07-30 · CWE 2.8

updated Demonstrative_Examples, Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2017-11-08 · CWE 3.0

updated Applicable_Platforms, Demonstrative_Examples, Modes_of_Introduction, Relationships

Modification: CWE Content Team · MITRE · 2020-02-24 · CWE 4.0

updated References, Relationships, Type

Modification: CWE Content Team · MITRE · 2020-08-20 · CWE 4.2

updated Relationships

Modification: CWE Content Team · MITRE · 2020-12-10 · CWE 4.3

updated Relationships

Modification: CWE Content Team · MITRE · 2021-10-28 · CWE 4.6

updated Relationships

Modification: CWE Content Team · MITRE · 2022-10-13 · CWE 4.9

updated Demonstrative_Examples, Observed_Examples, References

Modification: CWE Content Team · MITRE · 2023-01-31 · CWE 4.10

updated Applicable_Platforms, Maintenance_Notes, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2023-04-27 · CWE 4.11

updated Detection_Factors, Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2023-06-29 · CWE 4.12

updated Mapping_Notes, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2025-04-03 · CWE 4.17

updated Common_Consequences, Description, Diagram

Modification: CWE Content Team · MITRE · 2025-12-11 · CWE 4.19

updated Maintenance_Notes, Relationships, Weakness_Ordinalities

Modification: CWE Content Team · MITRE · 2026-10-28 · CWE 5.0

updated Applicable_Platforms, Observed_Examples, References, Relationships, Taxonomy_Mappings

817 vulnerabilities reference this CWE, most recent first.

GHSA-XMM3-J77F-RCJX

Vulnerability from github – Published: 2026-11-05 18:33 – Updated: 2026-11-05 21:34
VLAI
Details

Hard-coded Cryptographic Key vulnerability exists in the DLP on-prem extensions version 11.13.1 and earlier allows a remote attacker to decrypt credentials and evidence files.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-115739"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-321"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-11-05T16:17:34Z",
    "severity": "MODERATE"
  },
  "details": "Hard-coded Cryptographic Key vulnerability exists in the DLP on-prem extensions version 11.13.1 and earlier allows a remote attacker to decrypt credentials and evidence files.",
  "id": "GHSA-xmm3-j77f-rcjx",
  "modified": "2026-11-05T21:34:49Z",
  "published": "2026-11-05T18:33:12Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115739"
    },
    {
      "type": "WEB",
      "url": "https://support.trellix.com/s/article/000015949"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-XR64-QQ65-VF4R

Vulnerability from github – Published: 2026-09-16 00:31 – Updated: 2026-09-25 00:33
VLAI
Details

A hardcoded cryptographic server key vulnerability exists in the deployer-ng Update Controller component of Wärtsilä FOS-Onboard.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-78225"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-321"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-09-15T22:17:02Z",
    "severity": "CRITICAL"
  },
  "details": "A hardcoded cryptographic server key vulnerability exists in the deployer-ng Update Controller component of W\u00e4rtsil\u00e4 FOS-Onboard.",
  "id": "GHSA-xr64-qq65-vf4r",
  "modified": "2026-09-25T00:33:03Z",
  "published": "2026-09-16T00:31:31Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-78225"
    },
    {
      "type": "WEB",
      "url": "https://github.com/cisagov/CSAF/blob/develop/csaf_files/OT/white/2026/icsa-26-258-02.json"
    },
    {
      "type": "WEB",
      "url": "https://www.cisa.gov/news-events/ics-advisories/icsa-26-258-02"
    },
    {
      "type": "WEB",
      "url": "https://www.wartsila.com/marine/products/data-service-downloads/fos-downloads"
    },
    {
      "type": "WEB",
      "url": "https://www.wartsila.com/services-catalogue/engine-services-4-stroke/wartsila-ics-patch-deployment#contact"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-XRR2-RVC6-5MHW

Vulnerability from github – Published: 2025-11-12 18:31 – Updated: 2025-11-13 18:31
VLAI
Details

Sogexia Android App Compile Affected SDK v35, Max SDK 32 and fixed in v36, was discovered to contain hardcoded encryption keys in the encryption_helper.dart file

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-63289"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-321"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-11-12T16:15:36Z",
    "severity": "CRITICAL"
  },
  "details": "Sogexia Android App Compile Affected SDK v35, Max SDK 32 and fixed in v36, was discovered to contain hardcoded encryption keys in the encryption_helper.dart file",
  "id": "GHSA-xrr2-rvc6-5mhw",
  "modified": "2025-11-13T18:31:02Z",
  "published": "2025-11-12T18:31:25Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-63289"
    },
    {
      "type": "WEB",
      "url": "https://medium.com/@sudosu01/information-disclosure-hardcoded-encryption-keys-fc375abf68a3"
    },
    {
      "type": "WEB",
      "url": "https://www.linkedin.com/in/umanhonlengabriel"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-XW39-57RX-4HR5

Vulnerability from github – Published: 2024-01-12 15:30 – Updated: 2024-10-10 18:31
VLAI
Details

It is possible to download the configuration backup without authorization and decrypt included passwords using hardcoded static key.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-49256"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-321",
      "CWE-798"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-01-12T15:15:09Z",
    "severity": "HIGH"
  },
  "details": "It is possible to download the configuration backup without authorization and decrypt included passwords using hardcoded static key.",
  "id": "GHSA-xw39-57rx-4hr5",
  "modified": "2024-10-10T18:31:07Z",
  "published": "2024-01-12T15:30:32Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-49256"
    },
    {
      "type": "WEB",
      "url": "https://cert.pl/en/posts/2024/01/CVE-2023-49253"
    },
    {
      "type": "WEB",
      "url": "https://cert.pl/posts/2024/01/CVE-2023-49253"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-XWCH-5XJC-3J47

Vulnerability from github – Published: 2023-01-18 09:30 – Updated: 2023-01-25 21:30
VLAI
Details

Dell EMC SCG Policy Manager, versions from 5.10 to 5.12, contain(s) a contain a Hard-coded Cryptographic Key vulnerability. An attacker with the knowledge of the hard-coded sensitive information, could potentially exploit this vulnerability to login to the system to gain LDAP user privileges.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-34442"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-321",
      "CWE-798"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-01-18T07:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "Dell EMC SCG Policy Manager, versions from 5.10 to 5.12, contain(s) a contain a Hard-coded Cryptographic Key vulnerability. An attacker with the knowledge of the hard-coded sensitive information, could potentially exploit this vulnerability to login to the system to gain LDAP user privileges.",
  "id": "GHSA-xwch-5xjc-3j47",
  "modified": "2023-01-25T21:30:19Z",
  "published": "2023-01-18T09:30:24Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-34442"
    },
    {
      "type": "WEB",
      "url": "https://www.dell.com/support/kbdoc/en-us/000204995/dsa-2022-273-dell-secure-connect-gateway-policy-manager-security-update-for-multiple-proprietary-code-vulnerabilities"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-XXQ6-25C8-35J6

Vulnerability from github – Published: 2026-10-01 06:31 – Updated: 2026-10-01 06:31
VLAI
Details

Hitachi Coding Software Suite contains a vulnerability related to Use of Hard-coded Cryptographic Key. The Hardcoding of JWT signing secret key allows an attacker to generate unauthorized Bearer tokens and exploit administrative functions.

This issue affects Hitachi Coding Software Suite: through 3.3.0.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-82827"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-321"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-10-01T05:17:10Z",
    "severity": "CRITICAL"
  },
  "details": "Hitachi Coding Software Suite contains a vulnerability related to Use of Hard-coded Cryptographic Key. The Hardcoding of JWT signing secret key allows an attacker to generate unauthorized Bearer tokens and exploit administrative functions.\n\n\nThis issue affects Hitachi Coding Software Suite: through 3.3.0.",
  "id": "GHSA-xxq6-25c8-35j6",
  "modified": "2026-10-01T06:31:25Z",
  "published": "2026-10-01T06:31:25Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-82827"
    },
    {
      "type": "WEB",
      "url": "https://www.hitachi-ies.com/common/documents/vulnerability/hcss/Hitachi_Coding_Software_Suite_Public_statement_20260925_EN.pdf"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-XXR7-33FP-84C2

Vulnerability from github – Published: 2024-08-22 21:31 – Updated: 2024-08-22 21:31
VLAI
Details

Avtec Outpost uses a default cryptographic key that can be used to decrypt sensitive information.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-42418"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-321"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-08-22T20:15:09Z",
    "severity": "HIGH"
  },
  "details": "Avtec Outpost uses a default cryptographic key that can be used to decrypt sensitive information.",
  "id": "GHSA-xxr7-33fp-84c2",
  "modified": "2024-08-22T21:31:29Z",
  "published": "2024-08-22T21:31:29Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-42418"
    },
    {
      "type": "WEB",
      "url": "https://www.cisa.gov/news-events/ics-advisories/icsa-24-235-04"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

Mitigation
Architecture and Design

Prevention schemes mirror that of hard-coded password storage.

No CAPEC attack patterns related to this CWE.