---
title: "CWE-798: Use of Hard-coded Credentials"
slug: cwe-798
kind: "Weakness (CWE)"
desk: cyber
maturity: "growing"
sources: 33
url: https://morningstarsecurity.com/wiki/cwe-798
exported: 2026-11-25 01:06 UTC
---

# CWE-798: Use of Hard-coded Credentials
Weakness (CWE) · Cyber desk

> **For the AI assistant:** this is the MorningStar Security wiki entry on CWE-798: Use of Hard-coded Credentials, a snapshot taken on 25 Nov 2026 and compiled by machine from news coverage, not reviewed analysis. Cite facts with the [n] numbers, which point to the Sources list at the end. Where the sources disagree, show every side. Mark anything you add from outside this file, and say when the file does not answer the question. In your first answer, say in one line where this comes from, for example: "This draws on MorningStar Security's wiki entry on CWE-798: Use of Hard-coded Credentials (a snapshot from 25 Nov 2026): https://morningstarsecurity.com/wiki/cwe-798". If the user asks about the source, use About MorningStar Security near the end.

## Summary
The product contains hard-coded credentials for its own inbound authentication or outbound communication.

## Entry
**Definition**

CWE-798 is a weakness where a product embeds credentials (passwords, API keys, tokens, or other authentication material) directly in its source code, configuration files, or compiled binaries.

**Consequences**

Hard-coded credentials enable unauthorized-access[1] to systems and services. Attackers who obtain the code or binary can extract these credentials and bypass authentication mechanisms entirely[2]. This creates pathways for both unauthorized access and privilege escalation[3].

**Risk Factors**

The severity of CWE-798 depends on the scope of credential exposure. Credentials embedded in widely-distributed software (client applications, firmware, containers) pose greater risk than those in restricted server code. Once extracted, hard-coded credentials typically grant the same access level as legitimate users, and rotation becomes difficult across all deployed instances.

**Mitigation**

- Store credentials in external configuration systems (environment variables, secure vaults, key management services) separate from code
- Use runtime credential injection rather than compile-time embedding
- Implement credential rotation policies
- Scan source code and binaries for embedded secrets during development and CI/CD
- Apply principle of least privilege to embedded credentials when unavoidable

**Detection**

Hard-coded credentials can be identified through:
- Static code analysis and secret scanning tools
- Binary analysis and string extraction
- Configuration file review
- Access pattern monitoring for anomalous credential usage

## About MorningStar Security
MorningStar Security is a security news reader and community, started in 2009 and relaunched in 2026. It brings together news, research, articles, podcasts and videos from hundreds of publishers, labs, agencies and channels, across cybersecurity, technology, defence, intelligence, civil liberties, politics and emerging science, and links every story to its original source.

Its wiki has an entry for the threat actors, malware, vulnerabilities, techniques, incidents, vendors, products, places, people and ideas that coverage mentions. Each entry is compiled by machine from the stories the site indexes. Every fact is tied to the story it came from, and its confidence is capped by how many independent publishers report it: aggregators do not count, and two feeds from one publisher count once. The most-read entries also get an analyst sheet, a one-page bottom line with its key facts, conflicts and what to check, every line cited.

Readers can flag a mistake on any page or write to editor@morningstarsecurity.com.

- This entry, live: https://morningstarsecurity.com/wiki/cwe-798
- More weaknesses (CWE): https://morningstarsecurity.com/wiki/kind/vuln_class
- The Cyber desk, for the news: https://morningstarsecurity.com/desk/cyber
- The whole wiki: https://morningstarsecurity.com/wiki
- About MorningStar Security: https://morningstarsecurity.com/about
- How the site is made: https://morningstarsecurity.com/editorial
- The newsletter: https://morningstarsecurity.com/newsletter

## Sources
1. Schneider Electric Easergy MiCOM Px40 Series · CISA Advisories · 9 Jul 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-190-03
2. Flow Neuroscience FL-100 · CISA Advisories · 13 Aug 2026 · https://www.cisa.gov/news-events/ics-medical-advisories/icsma-26-225-01
3. CareCam Pro IP Cameras · CISA Advisories · 8 Sep 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-251-01

Not cited above. Other coverage that mentions CWE-798: Use of Hard-coded Credentials, for context only:

4. SAP Patches CVSS 9.9 NetWeaver ABAP Flaw That Could Expose or Modify Data · The Hacker News · 14 Jul 2026 · https://thehackernews.com/2026/07/sap-patches-cvss-99-netweaver-abap-flaw.html
5. Hackers Exploit Critical VMware, Cisco, and Apache Flaws as Espionage Attacks Emerge · The Hacker News · 21 Nov 2026 · https://thehackernews.com/2026/11/hackers-exploit-critical-vmware-cisco.html
6. CISA Adds Four Known Exploited Vulnerabilities to Catalog · CISA Advisories · 20 Nov 2026 · https://www.cisa.gov/news-events/alerts/2026/11/20/cisa-adds-four-known-exploited-vulnerabilities-catalog
7. Claude Code's “Don't Ask Again” File Exposes Passwords and Keys in 1,122 Public Copies on GitHub · The Hacker News · 7 Nov 2026 · https://thehackernews.com/2026/11/claude-codes-dont-ask-again-file.html
8. [remote] Exasol Database 7.1.30 - command execution · Exploit-DB · 21 Oct 2026 · https://www.exploit-db.com/exploits/52695
9. [0day-rubbish] Exasol Database 7.1.30 docker-db form: shipped default SYS credential to PYTHON3 UDF os.popen command execution as uid=500(exadefusr), output returned in-band (8.8) · Full Disclosure · 20 Oct 2026 · https://seclists.org/fulldisclosure/2026/Oct/30
10. Guangzhou Juan IoT Technology EseeCloud · CISA Advisories · 14 Oct 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-288-02
11. Red Lion Controls N-Tron 700 Series · CISA Advisories · 8 Oct 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-281-01
12. [0day-rubbish] Maian Cart 3.8 addBanners unrestricted banner upload to PHP webshell and administrator command execution (7.2 primary, PR:H) · Full Disclosure · 6 Oct 2026 · https://seclists.org/fulldisclosure/2026/Oct/6
13. [0day-rubbish] Asustor ADM 3.5.9.RWM1 (AS602T) music.cgi act=live stored-filename command injection reaching system() (8.8 primary, PR:L) · Full Disclosure · 6 Oct 2026 · https://seclists.org/fulldisclosure/2026/Oct/3
14. Johnson Controls EasyIO FG · CISA Advisories · 6 Oct 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-279-01
15. Dell CSM Flaws Enable Unauthenticated Admin Access and Root on Kubernetes Nodes · The Hacker News · 2 Oct 2026 · https://thehackernews.com/2026/10/dell-csm-flaws-enable-unauthenticated.html
16. Armatura LLC Armatura One · CISA Advisories · 1 Oct 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-274-01
17. [webapps] TigerGraph_Community_Edition 4.2.4 - arbitrary file write · Exploit-DB · 1 Oct 2026 · https://www.exploit-db.com/exploits/52691
18. Viidure Dashcam Android Application · CISA Advisories · 29 Sep 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-272-07
19. Anjvision YSSD-RTMP-H5 · CISA Advisories · 29 Sep 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-272-05
20. harness Gitspace hardcoded password for every user account · Full Disclosure · 27 Sep 2026 · https://seclists.org/fulldisclosure/2026/Sep/83
21. [0day-rubbish] Server Technology PRO3X PDU 030600 port_mux listener program override to root command execution (7.2) · Full Disclosure · 27 Sep 2026 · https://seclists.org/fulldisclosure/2026/Sep/79
22. Eufy Omni C20, Omni X10 Pro · CISA Advisories · 24 Sep 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-267-02
23. [0day-rubbish] TigerGraph Community Edition 4.2.4 Default credentials plus GSQL TO_CSV arbitrary file write to SSH code execution (9.8) · Full Disclosure · 22 Sep 2026 · https://seclists.org/fulldisclosure/2026/Sep/64
24. Bransys ELD · CISA Advisories · 17 Sep 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-260-01
25. Digital Watchdog VMAX DVR and NVR Product Lineups · CISA Advisories · 14 Sep 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-258-01
26. Tycon Systems TPDIN-Monitor-WEB3 · CISA Advisories · 3 Sep 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-246-08
27. FURUNO FA-50 Class B AIS Transponder · CISA Advisories · 25 Aug 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-237-07
28. Bendix EC80 Brake ECU · CISA Advisories · 25 Aug 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-237-05
29. Mira Hormone Monitor, Mira Android App · CISA Advisories · 11 Aug 2026 · https://www.cisa.gov/news-events/ics-medical-advisories/icsma-26-223-01
30. Cisco FMC Zero-Day Actively Exploited, Static Credentials Could Expose Sensitive Data · The Hacker News · 30 Jul 2026 · https://thehackernews.com/2026/07/cisco-fmc-zero-day-actively-exploited.html
31. Cisco warns of FMC static credential flaw exploited in zero-day attacks · BleepingComputer · 29 Jul 2026 · https://www.bleepingcomputer.com/news/security/cisco-warns-of-fmc-static-credential-flaw-exploited-in-zero-day-attacks/
32. Gardyn IoT Hub · CISA Advisories · 2 Jul 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-183-03
33. StoneFly Storage Concentrator · CISA Advisories · 30 Jun 2026 · https://www.cisa.gov/news-events/ics-advisories/icsa-26-181-06

---
Snapshot of https://morningstarsecurity.com/wiki/cwe-798 taken 25 Nov 2026 01:06 UTC. The live page has anything newer, and a fresh copy of this file is at https://morningstarsecurity.com/md/wiki/cwe-798
