CWE•Variant•Draft•20 recent CVEs
CWE-259Use of Hard-coded Password
Description
The product contains a hard-coded password, which it uses for its own inbound authentication or for outbound communication to external components.
[object Object]
Common consequences
- Access Control→Gain Privileges or Assume IdentityIf hard-coded passwords are used, it is almost certain that malicious users can gain access through the account in question.
- Access Control→Gain Privileges or Assume Identity,Hide Activities,Reduce MaintainabilityA hard-coded password typically leads to a significant authentication failure that can be difficult for the system administrator to detect. Once detected, it can be difficult to fix, so the administrator may be forced into disabling the pro
Potential mitigations
- Architecture and DesignFor outbound authentication: store passwords outside of the code in a strongly-protected, encrypted configuration file or database that is protected from access by all outsiders, including other local users on the same system. Properly protect the key (CWE-320). If you cannot use encryption to protect the file, then make sure that the permissions are as restrictive as possible.
- Architecture and DesignFor inbound authentication: Rather than hard-code a default username and password for first time logins, utilize a "first login" mode that requires the user to enter a unique strong password.
- Architecture and DesignPerform access control checks and limit which entities can access the feature that requires the hard-coded password. For example, a feature might only be enabled through the system console instead of through a network connection.
- Architecture and Design[object Object]
- Architecture and Design[object Object]
Related CWEs
Recent CVEs classified under this CWE
CVE-2026-115525.32026-06-08CVE-2026-115155.32026-06-08CVE-2026-359059.82026-06-04CVE-2026-220552026-06-03CVE-2026-220542026-06-03CVE-2026-72519.82026-05-26CVE-2026-80327.32026-05-06CVE-2026-75797.32026-05-01CVE-2026-66103.72026-04-20CVE-2026-65785.62026-04-19CVE-2026-65747.32026-04-19CVE-2025-571756.42026-04-08CVE-2026-49933.32026-03-28CVE-2026-44758.82026-03-20CVE-2026-42165.32026-03-16CVE-2025-700419.82026-03-11CVE-2025-708028.42026-03-10CVE-2025-707988.42026-03-10CVE-2026-27023.12026-02-19CVE-2026-26168.82026-02-17