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. There are two main variations:
In the Inbound variant, a default administration account is created, and a simple password is hard-coded into the product and associated with that account. This hard-coded password is the same for each installation of the product, and it usually cannot be changed or disabled by system administrators without manually modifying the program, or otherwise patching the product. If the password is ever discovered or published (a common occurrence on the Internet), then anybody with knowledge of this password can access the product. Finally, since all installations of the product will have the same password, even across different organizations, this enables massive attacks such as worms to take place.
The Outbound variant applies to front-end systems that authenticate with a back-end service. The back-end service may require a fixed password which can be easily discovered. The programmer may simply hard-code those back-end credentials into the front-end product. Any user of that program may be able to extract the password. Client-side systems with hard-coded passwords pose even more of a threat, since the extraction of a password from a binary is usually very simple.
Scope | Impact | Likelihood |
---|---|---|
Access Control | Gain Privileges or Assume Identity Note: If hard-coded passwords are used, it is almost certain that malicious users will gain access through the account in question. |
References | Description |
---|---|
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 |
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.
For front-end to back-end connections: Three solutions are possible, although none are complete.
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.
Name | Organization | Date | Date release | Version |
---|---|---|---|---|
7 Pernicious Kingdoms | Draft 3 |
Name | Organization | Date | Comment |
---|---|---|---|
Eric Dalci | Cigital | updated Time_of_Introduction | |
KDM Analytics | added/updated white box definitions | ||
Veracode | Suggested OWASP Top Ten 2004 mapping | ||
CWE Content Team | MITRE | updated Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings, Weakness_Ordinalities | |
CWE Content Team | MITRE | updated Description, Potential_Mitigations | |
CWE Content Team | MITRE | Significant description modifications to emphasize different variants. | |
CWE Content Team | MITRE | updated Demonstrative_Examples, Description, Maintenance_Notes, Other_Notes, Potential_Mitigations | |
CWE Content Team | MITRE | updated Demonstrative_Examples, Description, Maintenance_Notes, Potential_Mitigations, Relationships | |
CWE Content Team | MITRE | updated Potential_Mitigations | |
KDM Analytics | Improved the White_Box_Definition | ||
CWE Content Team | MITRE | updated Demonstrative_Examples, Related_Attack_Patterns, White_Box_Definitions | |
CWE Content Team | MITRE | updated Demonstrative_Examples, Description, Detection_Factors, Name, Potential_Mitigations, Relationships | |
CWE Content Team | MITRE | updated Applicable_Platforms | |
CWE Content Team | MITRE | updated Detection_Factors, Potential_Mitigations | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Common_Consequences, Potential_Mitigations, Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated References, Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Demonstrative_Examples | |
CWE Content Team | MITRE | updated Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Demonstrative_Examples | |
CWE Content Team | MITRE | updated Related_Attack_Patterns | |
CWE Content Team | MITRE | updated Related_Attack_Patterns | |
CWE Content Team | MITRE | updated Causal_Nature, Demonstrative_Examples, Likelihood_of_Exploit, Modes_of_Introduction, Relationships, White_Box_Definitions | |
CWE Content Team | MITRE | updated Relationships, Taxonomy_Mappings | |
CWE Content Team | MITRE | updated Related_Attack_Patterns | |
CWE Content Team | MITRE | updated References, Relationships, Type | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Demonstrative_Examples, Maintenance_Notes | |
CWE Content Team | MITRE | updated Relationships | |
CWE Content Team | MITRE | updated Demonstrative_Examples, Observed_Examples, References | |
CWE Content Team | MITRE | updated Applicable_Platforms, Description | |
CWE Content Team | MITRE | updated Detection_Factors, References, Relationships | |
CWE Content Team | MITRE | updated Mapping_Notes | |
CWE Content Team | MITRE | updated Observed_Examples |