Hard-Coded Credentials in Device Firmware

Device firmware contains fixed passwords, keys or tokens shared by every unit, which anyone who extracts them can use to access devices or the services they connect to.

SeverityHigh
CVSS 3.18.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H Open in the calculator
CVSS 4.09.2 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Open in the calculator
CWECWE-798: Use of Hard-coded Credentials
OWASP Top 10A07:2025 Authentication Failures
MITRE ATT&CKT1078.001 Default Accounts, T1552.001 Credentials In Files
CategoryInformation Disclosure

Description

Hard-coded credentials are passwords, private keys, API keys or tokens built into a device's firmware, rather than created for each device or set by its owner. Typical examples are a root or support account password in the firmware's /etc/shadow or /etc/passwd file, an account accepted by a Telnet, SSH or web service that the owner cannot change or disable, a private key for TLS or SSH shared by every device of the model, and credentials or keys that the device uses to reach the manufacturer's cloud services.

Because every unit runs the same image, the credentials are the same on every device, and anyone can recover them from a firmware image downloaded from the manufacturer's website, captured during an update, or read from the device's flash memory. An attacker who does so can use them against every device that runs the firmware, often with administrative or root access, to take control of the device, read the data it handles, change its behaviour or use it to reach other systems. Shared private keys let the attacker impersonate devices or decrypt their traffic, and embedded cloud credentials can expose the manufacturer's service and other customers' data. The owner usually cannot remove the credentials without a firmware fix.

The effort needed depends on whether the credentials are stored in clear text or as hashes that must be cracked, and on whether the services that accept them are reachable. The weakness is identified by extracting the file system with tools such as binwalk, searching it for password files, keys, configuration files and strings in binaries, cracking any password hashes found, and testing the recovered credentials against the device's services.

Remediation

The root cause lies in the firmware, so the full fix rests with the manufacturer or development team:

  • Remove all fixed passwords and shared keys from firmware. Require the owner to set a unique password on first use, or generate a unique password for each device during manufacture, and allow every account to be changed or disabled.
  • Generate keys and certificates on each device, or provision them individually during manufacture, and keep them in protected storage such as a secure element or TPM where the hardware has one.
  • Remove debug and support accounts, and the services that accept them such as Telnet, from production firmware.
  • Give each device its own credentials for cloud services, so that a key extracted from one device cannot be used to reach others or the wider service.
  • Scan firmware builds for embedded secrets before release.

For consumer products sold in the UK, the Product Security and Telecommunications Infrastructure regime has prohibited universal default passwords since April 2024, and ETSI EN 303 645 sets the same expectation. Where the devices are bought rather than built, report the issue to the manufacturer and apply its fix when available; as an interim measure, change any credentials the device allows to be changed, disable unneeded services, and place the devices on a restricted network segment so that their services cannot be reached from user networks or the internet. Confirm the fix by examining the updated firmware and checking that the credentials are gone and no longer work.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More IoT and OT Findings

Every IoT and OT finding