CWEweakness

CWE-259 Use of Hard-coded Password

High Official page ↗
Abstraction
Variant
Structure
Simple
Status
Draft
Likelihood of exploit
High
Languages
Not Language-Specific
CWE version
5.0

Description

The product contains a hard-coded password, which it uses for its own inbound authentication or for outbound authentication to external components.

Common consequences

• Access Control: Gain Privileges or Assume Identity — If 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 Maintainability — A 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 product entirely.

Potential mitigations

• [Architecture and Design] For 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 Design] For 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 Design] Perform 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] For inbound authentication: apply strong one-way hashes to your passwords and store those hashes in a configuration file or database with appropriate access control. That way, theft of the file/database still requires the attacker to try to crack the password. When receiving an incoming password during authentication, take the hash of the password and compare it to the hash that you have saved. Use randomly assigned salts for each separate hash that you generate. This increases the amount of computation that an attacker needs to conduct a brute-force attack, possibly limiting the effectiveness of the rainbow table method. • [Architecture and Design] For front-end to back-end connections: Three solutions are possible, although none are complete. The first suggestion involves the use of generated passwords which are changed automatically and must be entered at given time intervals by a system administrator. These passwords will be held in memory and only be valid for the time intervals. Next, the passwords used should be limited at the back end to only performing actions valid for the front end, as opposed to having full access. Finally, the messages sent should be tagged and checksummed with time sensitive values so as to prevent replay style attacks.

Detection methods

• Manual Analysis: This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session. • Black Box: Use monitoring tools that examine the software's process as it interacts with the operating system and the network. This technique is useful in cases when source code is unavailable, if the software was not developed by you, or if you want to verify that the build phase did not introduce any new weaknesses. Examples include debuggers that directly attach to the running process; system-call tracing utilities such as truss (Solaris) and strace (Linux); system activity monitors such as FileMon, RegMon, Process Monitor, and other Sysinternals utilities (Windows); and sniffers and protocol analyzers that monitor network traffic. Attach the monitor to the process and perform a login. Using disassembled code, look at the associated instructions and see if any of them appear to be comparing the input to a fixed string or value. • 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.)

Observed examples

• CVE-2022-29964: Distributed Control System (DCS) has hard-coded passwords for local shell access • CVE-2021-37555: Telnet service for IoT feeder for dogs and cats has hard-coded password [REF-1288] • CVE-2021-35033: Firmware for a WiFi router uses a hard-coded password for a BusyBox shell, allowing bypass of authentication through the UART port

Related

Observed example · CVE (3)

  • CVE-2022-29964 The Emerson DeltaV Distributed Control System (DCS) controllers and IO cards through 2022-04-29 misuse passwords. vulnerability
  • CVE-2021-35033 A vulnerability in specific versions of Zyxel NBG6818, NBG7815, WSQ20, WSQ50, WSQ60, and WSR30 firmware with pre-configured password… vulnerability
  • CVE-2021-37555 TX9 Automatic Food Dispenser v3.2.57 devices allow access to a shell as root/superuser, a related issue to CVE-2019-16734. vulnerability

Child of · CWE (1)

  • CWE-798 Use of Hard-coded Credentials weakness

Peer of · CWE (2)

  • CWE-257 Storing Passwords in a Recoverable Format weakness
  • CWE-321 Use of Hard-coded Cryptographic Key weakness

Referenced by CVE · weakness (221)

  • CVE-2026-113736 A vulnerability has been found in D-Link DHP-W610AV 1.02EUb03. vulnerability
  • CVE-2026-112146 A vulnerability was detected in D-Link E15, M32, R15 and R32. vulnerability
  • CVE-2026-110667 A security flaw has been discovered in cemtan sar2html 4.0.0. vulnerability
  • CVE-2026-108831 A security vulnerability has been detected in meetecho janus-gateway up to 1.4.2. vulnerability
  • CVE-2026-108584 A security flaw has been discovered in FunnyWolf Viper up to 3.1.11. vulnerability
  • CVE-2026-105141 A security flaw has been discovered in topoteretes cognee up to 1.5.4. vulnerability
  • CVE-2026-105147 A vulnerability was determined in SciPhi-AI R2R up to 3.6.6. vulnerability
  • CVE-2026-101052 A security vulnerability has been detected in refly-ai refly up to 1.1.0. vulnerability
  • CVE-2026-70413 Dell Live Optics Collector, versions prior to 27.2.13.310, contain(s) a Use of Hard-coded Password vulnerability. vulnerability
  • CVE-2026-97877 A vulnerability was determined in zhistaredu StarTraining up to 3.8.1. vulnerability
  • CVE-2026-96548 A flaw has been found in sfturing hosp_order up to 627f426331da8086ce8fff2017d65b1ddef384f8. vulnerability
  • CVE-2026-65117 NVIDIA Infrastructure Controller for Linux contains a vulnerability where an attacker could cause use of a hard-coded password. vulnerability
  • CVE-2026-93969 A vulnerability was identified in aiyiyi121 SxDevOps 1.0/1.1. vulnerability
  • CVE-2026-93970 A security flaw has been discovered in aiyiyi121 SxDevOps 1.0/1.1. vulnerability
  • CVE-2026-90509 A weakness has been identified in dromara orion-visor up to 2.5.7. vulnerability
  • CVE-2026-71809 Authentication Bypass via Hardcoded Master Verification Code vulnerability in Siam Ordering (siam-server) 1.0.0 allows remote… vulnerability
  • CVE-2026-86673 A vulnerability was determined in ningzichun Student Management System up to 98760f5711cf6dc8b4adca53a9e207ca49b02ebf. vulnerability
  • CVE-2026-86276 A flaw has been found in SourceCodester Syllabus-Aligned Learning Management & Examination System 1.0. vulnerability
  • CVE-2026-86150 A security vulnerability has been detected in Tenda CP3 27.5.57.101. vulnerability
  • CVE-2026-70403 XING CPTrans-ME-X contains a Use of Hard-coded Password (CWE-259). vulnerability
  • CVE-2026-82808 A vulnerability was identified in Inbox Foundry ActiveInbox Extension up to 7.10.24 on Chrome. vulnerability
  • CVE-2026-78062 A vulnerability was identified in vas3k TaxHacker up to 0.8.2. vulnerability
  • CVE-2026-23933 In Zabbix 7.4 the cryptographic key used for signing Frontend sessions has been erroneously written to the database seed. vulnerability
  • CVE-2026-19900 A vulnerability was identified in LB-LINK X-PRO 1.0.22-20231206. vulnerability
  • CVE-2026-19901 A security flaw has been discovered in LB-LINK X-PRO 1.0.22-20231206. vulnerability
  • CVE-2026-19750 A flaw has been found in Tenda CH, CP and TX3 V21.x/V22.x/V25.x/V26.x/V27.x. vulnerability
  • CVE-2026-20316 A vulnerability in the web interface of Cisco Secure Firewall Management Center (FMC) Software could allow an unauthenticated, remote… vulnerability
  • CVE-2026-11515 A vulnerability has been found in SourceCodester Barangay Resident Profiling and Information Management System 1.0. vulnerability
  • CVE-2026-11552 A vulnerability has been found in SourceCodester Onlne Examination & Learning Management System and Syllabus-aligned Learning Management… vulnerability
  • CVE-2026-35905 T3 Technology CPE models T625Pro v1.0.07, T6825G v1.0.03, and T7281 v1.0.03 were discovered to contain a hardcoded password for root access… vulnerability
Show all 221 ›

Referenced by CWE · can precede (1)

  • CWE-656 Reliance on Security Through Obscurity weakness

Referenced by CWE · peer of (1)

  • CWE-257 Storing Passwords in a Recoverable Format weakness

Referenced by OWASP · mapped cwe (3)

  • A07:2025 Authentication Failures Top 10 2025
  • A02:2021 Cryptographic Failures Top 10 2021
  • A07:2021 Identification and Authentication Failures Top 10 2021