CWE-259: Use of Hard-coded Password

low-risk

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

Abstraction: Variant

Common Consequences

Access Control Gain Privileges or Assume Identity
Access Control Gain Privileges or Assume Identity

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

Real-World Examples (10)

CVE CVSS EPSS KEV
CVE-2024-7332 9.8 92.1%
CVE-2023-5222 6.3 90.2%
CVE-2025-57788 6.5 83.1%
CVE-2025-8730 9.8 26.5%
CVE-2023-2645 9.8 6.2%
CVE-2025-1100 9.8 1.8%
CVE-2022-29831 7.5 1.6%
CVE-2024-26196 4.3 1.2%
CVE-2021-32525 9.1 1.0%
CVE-2024-41616 9.8 0.8%
2
/ 100
low-risk
Active Threat 2/50 · Minimal
Exploit Availability 0/50 · Minimal