What MITRE CWE-798 - Use of Hard-coded Credentials requires
CWE-798 (Use of Hard-coded Credentials) is a CWE Top 25 weakness consistently present in firmware, IoT devices, network appliances, default-install software, and codebases that have leaked private repositories or expanded build artifacts. CWE-798 is defined as: the product contains hard-coded credentials, such as a password or cryptographic key. The Extended Description identifies two main variations. Inbound: the product includes authentication that compares input credentials against hard-coded values; a default administration account is created with a simple, unchangeable password identical across all installations. Outbound: the product connects to another system using hard-coded credentials; this commonly affects front-end systems authenticating with back-end services where fixed passwords are embedded in code. Common Consequences include access control violation (if hard-coded passwords are used, it is almost certain that malicious users will gain access to the account in question; extraction from binaries is typically simple, especially for client-side systems) and integrity, confidentiality, availability impact (this weakness can lead to the exposure of resources or functionality to unintended actors, possibly providing attackers with sensitive information or even execute arbitrary code; widespread password knowledge enables massive attacks across different organizations). Potential Mitigations include storing credentials outside code in encrypted, access-restricted configuration files or databases; implementing first login mode requiring unique strong passwords instead of defaults; applying access controls limiting which entities can access hard-coded credential features; using one-way hashes with random salts for password storage and comparison; and for front-end and back-end connections, employing auto-rotating passwords, limiting backend access scope, and implementing time-sensitive checksums. Modern mitigations include centralized secret managers (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager, Doppler, 1Password Secrets Automation), workload identity (mTLS, OIDC federation, cloud workload identity), short-lived dynamic credentials, and continuous secret scanning (TruffleHog, gitleaks, GitGuardian).
Pillar: Cybersecurity · Authority: MITRE Corporation / Common Weakness Enumeration · Version: 1.0.0 · Last updated:
Primary source: https://cwe.mitre.org/data/definitions/798.html
SHA-256 integrity: b02879e556cbc60162d3cce2fc64570b9774e0e5e90ad7f4e025c8fb57cee3fd
Primary Citations — 10 traced to source
- CWE-798: Use of Hard-coded Credentials - MITRE Common Weakness Enumeration at https://cwe.mitre.org/data/definitions/798.html
- CWE-798 Definition - the product contains hard-coded credentials, such as a password or cryptographic key
+ 8 more citations (full bibliography, deterministic workflow, actionable schema and crosswalks) included in the vault unlock — $0.01 via Skyfire / L402 / Direct Base USDC.
Access