What Is CWE-798? Hard-Coded Credentials Explained
Security Beginner 5 min read

What Is CWE-798? Hard-Coded Credentials Explained

Hard-coded credentials (CWE-798) are secrets fixed in a product and shared by every install. Learn why appliances ship them and how to defend.

Published: November 22, 2026 • Updated: November 22, 2026
cwe-798hard-coded credentialsappliance securityvulnerability classes

Hard-coded credentials are passwords, keys, tokens or cookies that are fixed inside a product's code or image instead of being generated for each installation. MITRE tracks the weakness as CWE-798, Use of Hard-coded Credentials. The problem is simple: every copy of the product shares the same secret, so anyone who extracts it once can authenticate to every deployment. Cisco Expressway CVE-2026-76466, now in CISA's KEV catalog, is a current example: a persistent clustering cookie let unauthenticated attackers run commands as root.

What is CWE-798?

CWE-798 is the Common Weakness Enumeration entry for software that contains a credential the user cannot change or that is identical across installations. It covers passwords in source code, embedded private keys, static API tokens and fixed session cookies used between components.

The weakness has two common forms. Inbound hard-coded credentials are accounts baked into the product so that the vendor, a support tool or a peer component can log in. Outbound hard-coded credentials are secrets the product uses to authenticate itself to something else, such as a fixed database password. Both forms share one failure: the secret is a property of the product, not of your deployment, so a single disclosure affects every customer.

Why do appliances keep shipping hard-coded credentials?

Appliances are built from many components that need to trust each other, and the fastest way to make that work is a shared secret written at build time. Vendors often intend those secrets to be protected by another layer, such as a private network or TLS client certificates, and the hard-coded value only becomes exploitable when that other layer fails.

The Expressway case fits this pattern exactly. Cisco's advisory for CVE-2026-76466 says the database service that replicates configuration between cluster peers relies on persistent cookies, and that client certificates are not validated even when TLS Verify Mode is set to Enabled for clustering. The cookie was supposed to be one factor, the certificate the other. With certificate validation ineffective, the cookie became the only credential, and a credential that is the same everywhere is no credential at all. The result was a CVSS 9.8 remote root flaw. Our coverage of Cisco Expressway CVE-2026-76466 being exploited and added to KEV has the full timeline.

Other reasons the weakness persists:

  • Service-to-service authentication inside an appliance is rarely visible to the customer, so nobody asks for per-deployment secrets.
  • Clustering and replication protocols were often designed for isolated management networks and later exposed to the internet by deployment choices.
  • Rotating a built-in secret requires a software update that changes how peers authenticate, which is harder than issuing a patch for a parsing bug.
  • Static secrets make support and recovery easier, so there is internal pressure to keep them.

How do attackers find hard-coded credentials?

They extract the firmware or virtual appliance image, mount the filesystem, and search configuration files, binaries and startup scripts for strings that look like passwords, keys or cookies. Once the secret is known it can be reused against any other instance of the same product.

Nothing about this requires a vulnerability in the usual sense. The credential works as designed. That is why CWE-798 findings often carry CVSS scores near the maximum: the attack complexity is low because the hard part, recovering the secret, only has to be done once by one person. After a proof-of-concept is public, every exposed instance is reachable by anyone who downloads the exploit. The companion article on why a public PoC exploit should reset your patch deadline explains how fast that window closes.

Why is CVSS so high for this weakness class?

Hard-coded credentials usually give the attacker the privilege level of the component that owned the secret. In appliances that is often root, because internal services run with high privilege and talk to each other over local RPC or replication channels. When the channel is network reachable, the vector becomes AV:N with PR:N and UI:N, which is the CVSS 9.8 pattern Cisco assigned to CVE-2026-76466.

The score also reflects scale. A memory corruption bug may need a tailored exploit per build. A static secret works against every build that contains it, which for Expressway meant every clustered release from the X8 era through X15.5.3.

How do you defend against hard-coded credentials you cannot change?

You cannot rotate a secret the vendor fixed in the product, so the defence is to deny network access to the service that accepts it, apply the vendor's fix as soon as it exists, and watch the logs that the service writes.

In practice that means:

  1. Know which internal services your appliances expose. Clustering, replication, backup and support channels are the usual carriers of built-in credentials. Cisco's advisory names the Expressway database service, and F6's incident report points to TCP ports 4371 and 4372 as the ports to restrict to trusted cluster peers.
  2. Restrict those ports at the network layer to the exact peer addresses that need them. A firewall rule is a weaker control than fixed code, but it changes the attack from internet-wide to an attacker who is already inside your perimeter.
  3. Treat "TLS verification enabled" as a claim to be tested, not a guarantee. CVE-2026-76466 existed precisely because the setting did not do what its name implies.
  4. Forward the logs of the component that uses the credential. For Expressway the artifact F6 identified was a nodeup entry in the Erlang system log, not in the Event Log that most administrators forward. Follow the steps in how to audit a Cisco Expressway cluster after CVE-2026-76466 to collect it.
  5. When the vendor ships a fix for a CWE-798 flaw, read what changed. A real fix replaces the static secret with per-deployment material or enforces the second factor. A fix that only hides the secret better leaves you one firmware dump away from the same problem.

What should you ask vendors about built-in credentials?

Ask whether any component-to-component authentication uses a secret that is identical across installations, whether that secret is regenerated on install or on upgrade, and whether the service that accepts it is reachable from outside the management network. A vendor who cannot answer those three questions has not audited for CWE-798.

For products you already run, check the vendor's advisory history for CWE-798, CWE-259 (hard-coded password) and CWE-321 (hard-coded cryptographic key). A pattern of such findings is a signal that the architecture, not a single bug, is the problem, and that the product belongs behind strict network controls regardless of its patch level.