A hard-coded credential is a password or key built into a product's software by its maker.
This guide is for anyone who buys, runs or looks after devices and software, and for students new to security. You do not need to write code to be affected: routers, storage boxes and business apps can all ship with these hidden secrets.
In short
- Some products ship with a password or key written into their code, the same in every copy.
- Owners usually cannot see or change it. Only an update from the maker fixes it.
- Once one copy is studied and the secret is found, every unpatched copy may be open. That is why these flaws can score the top severity rating.
- Install security updates quickly, keep devices off the open internet where you can, and ask suppliers how they avoid this.
What you will learn
- Explain what a hard-coded credential is in one sentence.
- Spot the difference between a default password and a hard-coded one.
- Explain why these flaws get such high severity scores.
- Check that your devices get security updates on time.
- Built-in secret (hard-coded credential)
- a password or key written into a product's code, so the owner cannot change it.
- Severity score (CVSS)
- a number from 0 to 10 that rates how serious a security flaw is.
What is a hard-coded credential?
Think of a lock maker who builds the same secret master key into every lock of one model. You cannot change it, and you may not know it is there. If one copy of that key gets out, every lock of that model can be opened.
Software works the same way. A maker sometimes writes a password or key straight into a product's code. It may be a hidden admin account, or a key the product uses to connect to the maker's own services.[1]
This is a hard-coded credential. It is usually the same in every copy of the product. The owner usually cannot change or turn it off without an update from the maker.[1]
It is not the same as a default password. A default password is set at the factory, but you can and should change it. A hard-coded one stays put.
Where the comparison stops working: a master key has to be copied by hand. A secret in software can be pulled out of one copy by studying it, then shared online with anyone.
Why does it matter?
Flaws are rated from 0 to 10, and anything from 9.0 up counts as critical.[4] A built-in secret can earn the very top score. In 2025 Cisco rated a hard-coded token in some of its wireless controller software at 10.0, and released free updates to fix it.[2]
If you run a small business
What could happen: a stranger reaches your file server through a secret you never knew it had.
Check this: make sure someone installs security updates for every device.
If you are new to IT work
What could happen: you read "change the default password" and think the device is now safe.
Check this: read the maker's security notices as well as the manual.
If you are learning to code
What could happen: a test password you typed into your app ships to every user.
Check this: keep passwords and keys out of code, and let each install set its own.
What does it look like?
You will rarely see the secret itself. What you usually see is a security notice from the maker. Here is a made-up one.
Example only. All values are made up.
SECURITY NOTICE EXAMPLE-0000 (fake vendor, fake product) Product: ExampleBox file server, versions before 0.0.0 Issue: hard-coded credential in the product software (1) Severity: Critical, CVSS 10.0 (2) Can the owner change it? No (3) Fix: install version 0.0.0-EXAMPLE (4)
- In a real message, this line would say the secret is built in and the same on every unit.
- The top score, because an attacker may need no password and no help from a user.
- Changing your own passwords does not remove this built-in one.
- The maker's update is the fix. Until it is installed, the device stays exposed.
Why this is risky: the owner did nothing wrong, yet the device has a hidden way in. If the notice is missed, the gap stays open.
The safer way: someone reads the maker's notices, installs the update quickly and keeps the device off the open internet where possible.
How does it work?
Here is how a built-in secret usually goes from hidden to dangerous.
- The shortcut. A developer writes a password or key into the product's code, perhaps for support or to connect to a back-end service.[1]
- The shipping. Every copy of the product goes out with the same secret inside.
- The discovery. Someone studies one copy and finds the secret. Anyone with the code or the product file can often recover it.[1]
- The reach. Every unpatched copy that can be reached is now at risk. If the product faces the internet, that can be a large number.
- The fix. The maker releases an update that removes the secret or makes each copy use its own. Owners install it.

These flaws are not rare. A US government list of flaws known to be used by attackers includes several. One is a built-in key in Gladinet's CentreStack and Triofox file-sharing products, added to the list in April 2025.[3]
Makers can design this risk out. A US security agency urges makers to remove fixed passwords and to own their customers' security outcomes.[5] A common approach is for each device or install to set its own password on first use.[1]
A worked example
Xena Okafor looks after IT for a small fictional accountancy firm with fifteen staff. The firm keeps client files on a storage box in the office.
On Monday a security newsletter mentions a critical flaw in that storage box. The maker's notice says the software has a built-in key. It scores 10.0, and attackers are already using it.
Xena changed the default admin password when the box arrived. She checks the notice again. It says that change does not help, because the built-in key is separate and cannot be changed by owners.
She thinks of the lock maker's master key. Changing her own key does nothing if the lock has a second one built in. Only the maker can replace the lock.
So she follows the maker's advice in order. First she turns off the box's access from the internet, so only office computers can reach it. Then she installs the maker's update that evening.
Next she checks the box's access records for the past month. She looks for connections from outside the office. She finds none in the records available to her.
Last, she signs the firm's devices up for the makers' security notices. She adds a rule: critical updates go on within days, not at the next quiet month.
Myths and mistakes
| What people think | What is true |
|---|---|
| I changed the default password, so I am covered. | A hard-coded credential is separate and usually cannot be changed by owners.[1] Only the maker's update fixes it. |
| Nobody will find a secret hidden in the code. | Anyone with a copy of the product can study it, and secrets in code can often be recovered.[1] |
| Only big companies are affected. | The same secret sits in every copy, so small owners are exposed too. |
| A 10.0 score means the device is already hacked. | It rates how serious the flaw is, not whether you were attacked. Update, then check the records. |
| Hard-coded secrets only happen in old products. | They still turn up in current products, including security and network gear.[2] |
What can I do this week?
- List the devices and business apps you rely on, and who updates each one.
- Sign up for each maker's security notices.
- Check which devices can be reached from the internet, and close what does not need it.
- Ask new suppliers how their products avoid built-in passwords and keys.
Checklist
- Every device and app has a named person who installs its updates.
- Critical security updates go on within days.
- Devices are not open to the internet unless they need to be.
- Someone reads the makers' security notices.
- Default passwords are changed on day one, as a separate step.
- New products are checked for unique passwords and a clear update promise.
- Your own code keeps passwords and keys out of the source.
Common questions
What is the difference between a default and a hard-coded password?
A default password is preset at the factory, but you can change it. A hard-coded password is built into the software itself, usually the same in every copy, and owners normally cannot change it. Default passwords are your job to change. Hard-coded ones need the maker's update.
Why do these flaws get such high scores?
Because they are often easy to use and powerful. An attacker may need no password of their own and no help from a user. The same secret works on every unpatched copy. Scores of 9.0 and above count as critical, and some of these flaws score 10.0.
Can I find a hard-coded password myself?
Usually not, and you do not need to. Researchers and makers find them and publish notices. Your job is to know which products you use, read those notices and install the updates. Leave testing to people with permission and the right skills.
What should I do if a product I use is affected?
Follow the maker's notice. Install the update, or apply its stop-gap steps until you can, such as blocking access from the internet. Then check the device's records for unusual access since the flaw was announced. If you see signs of misuse, treat it as an incident.
Is this a non-human identity problem?
Yes, often. Many hard-coded secrets are keys that let one piece of software connect to another. These are non-human identities. Like any NHI, they need an owner and a way to be changed, which a built-in secret does not allow.
Where next?
Ready for the detail? Read the practitioner guide: Default Credential Breaches Lessons Guide. It goes further into lessons from real incidents, how to find preset and built-in credentials across your systems, and secure by design rules.
Also useful:
- Default Passwords for Beginners
- CVE and CVSS for Beginners
- Firmware and Device Updates for Beginners
- Secrets in Code for Beginners
- Non-Human Identities for Beginners
Related NHI Mgmt Group resources: How to find hard-coded secrets in container images · Internet-Exposed Devices for Beginners · Secrets Management Guide
Key terms
- Hard-coded credential
- A password, key or token written directly into code rather than stored and managed separately.
- Default credential
- A preset username or password that stays unchanged after a product is set up.
- CVSS
- A standard way to rate how serious a software flaw is, on a scale from 0 to 10.
- Vulnerability
- A weakness in software or a device that an attacker could use.
- Patch
- An update from the maker that fixes a flaw.
- Firmware
- The software built into a device, such as a router or storage box, that makes it work.
- Non-human identity (NHI)
- A digital identity, or the credential behind it, that represents a machine, application, automated process, service or AI agent, so it can authenticate, carry out tasks and connect to other systems without a person.[6]
Sources and further reading
- CWE-798: Use of Hard-coded Credentials. MITRE. https://cwe.mitre.org/data/definitions/798.html, accessed 28 Nov 2026.
- Cisco IOS XE Wireless Controller Software Arbitrary File Upload Vulnerability (CVE-2025-20188). Cisco Security Advisory, 7 May 2025. https://sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-wlc-file-uplpd-rHZG9UfC, accessed 28 Nov 2026.
- Known Exploited Vulnerabilities Catalog: CVE-2025-30406, Gladinet CentreStack and Triofox Use of Hard-coded Cryptographic Key Vulnerability (added 8 April 2025). CISA. https://www.cisa.gov/known-exploited-vulnerabilities-catalog, accessed 28 Nov 2026.
- Common Vulnerability Scoring System v3.1: Specification Document. FIRST. https://www.first.org/cvss/v3.1/specification-document, accessed 28 Nov 2026.
- Secure by Design Alert: How Manufacturers Can Protect Customers by Eliminating Default Passwords. CISA. https://www.cisa.gov/resources-tools/resources/secure-design-alert-how-manufacturers-can-protect-customers-eliminating-default-passwords, accessed 28 Nov 2026.
- The Ultimate Guide to Non-Human Identities. Lalit Choda, NHI Mgmt Group, January 2025. https://nhimg.org/the-ultimate-guide-to-non-human-identities, accessed 27 Nov 2026.