Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-798 (使用硬编码的凭证) — Vulnerability Class 559

559 vulnerabilities classified as CWE-798 (使用硬编码的凭证). AI Chinese analysis included.

CWE-798 represents a critical security weakness where authentication mechanisms rely on static, embedded credentials rather than dynamic verification. This flaw typically manifests as default administrative accounts with simple, hard-coded passwords or cryptographic keys stored directly within the source code or configuration files. Attackers exploit this vulnerability by scanning for these predictable credentials, gaining immediate, unauthorized access to sensitive systems without needing to bypass complex security controls. To mitigate this risk, developers must eliminate static secrets entirely, implementing robust credential management solutions such as secure vaults, environment variables, or hardware security modules. Additionally, enforcing strong password policies, regular key rotation, and multi-factor authentication ensures that access rights are dynamic and secure, significantly reducing the attack surface against unauthorized entry.

MITRE CWE Description
The product contains hard-coded credentials, such as a password or cryptographic key. There are two main variations: Inbound: the product contains an authentication mechanism that checks the input credentials against a hard-coded set of credentials. In this variant, a default administration account is created, and a simple password is hard-coded into the product and associated with that account. This hard-coded password is the same for each installation of the product, and it usually cannot be changed or disabled by system administrators without manually modifying the program, or otherwise patching the product. It can also be difficult for the administrator to detect. Outbound: the product connects to another system or component, and it contains hard-coded credentials for connecting to that component. This variant applies to front-end systems that authenticate with a back-end service. The back-end service may require a fixed password that can be easily discovered. The programmer may simply hard-code those back-end credentials into the front-end product.
Common Consequences (2)
Access ControlBypass Protection Mechanism
If hard-coded passwords are used, it is almost certain that malicious users will gain access to the account in question. Any user of the product that hard-codes passwords may be able to extract the password. Client-side systems with hard-coded passwords pose even more of a threat, since the extracti…
Integrity, Confidentiality, Availability, Access Control, OtherRead Application Data, Gain Privileges or Assume Identity, Execute Unauthorized Code or Commands, Other
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. If the password is ever discovered or published (a common occurrence on the Internet), then anybody with knowledge of thi…
Mitigations (5)
Architecture and DesignFor outbound authentication: store passwords, keys, and other credentials outside of the code in a strongly-protected, encrypted configuration file or database that is protected from access by all outsiders, including other local users on the same system. Properly protect the key (CWE-320). If you cannot use encryption to protect the file, then make sure that the permissions are as restrictive as …
Architecture and DesignFor inbound authentication: Rather than hard-code a default username and password, key, or other authentication credentials for first time logins, utilize a "first login" mode that requires the user to enter a unique strong password or key.
Architecture and DesignIf the product must contain hard-coded credentials or they cannot be removed, perform access control checks and limit which entities can access the feature that requires the hard-coded credentials. For example, a feature might only be enabled through the system console instead of through a network connection.
Architecture and DesignFor inbound authentication using passwords: apply strong one-way hashes to passwords and store those hashes in a configuration file or database with appropriate access control. That way, theft of the file/database still requires the attacker to try to crack the password. When handling an incoming password during authentication, take the hash of the password and compare it to the saved hash. Use ra…
Architecture and DesignFor front-end to back-end connections: Three solutions are possible, although none are complete. The first suggestion involves the use of generated passwords or keys that are changed automatically and must be entered at given time intervals by a system administrator. These passwords will be held in memory and only be valid for the time intervals. Next, the passwords or keys should be limited at th…
Examples (2)
The following code uses a hard-coded password to connect to a database:
... DriverManager.getConnection(url, "scott", "tiger"); ...
Bad · Java
javap -c ConnMngr.class 22: ldc #36; //String jdbc:mysql://ixne.com/rxsql 24: ldc #38; //String scott 26: ldc #17; //String tiger
Attack
The following code is an example of an internal hard-coded password in the back-end:
int VerifyAdmin(char *password) { if (strcmp(password, "Mew!")) { printf("Incorrect Password!\n"); return(0) } printf("Entering Diagnostic Mode...\n"); return(1); }
Bad · C
int VerifyAdmin(String password) { if (!password.equals("Mew!")) { return(0) } //Diagnostic Mode return(1); }
Bad · Java
CVE IDTitleCVSSSeverityPublished
CVE-2022-47617 Hitron Technologies Inc. CODA-5310 - Hard-coded Cryptographic Key — Hitron CODA-5310 7.2 High2023-06-02
CVE-2022-4333 Sprecher: Sprecon maintenance access with hardcoded credentials — SPRECON-E CPU PU243x 9.8 Critical2023-06-01
CVE-2023-31184 ROZCOM client — client 6.2 Medium2023-05-30
CVE-2023-2504 多款BirdDog产品信任管理问题漏洞 — STUDIO R3 8.4 High2023-05-22
CVE-2023-33236 MXsecurity Hardcoded Credential Vulnerability — MXsecurity Series 9.8 Critical2023-05-22
CVE-2023-26203 Fortinet FortiNAC 信任管理问题漏洞 — FortiNAC 6.1 Medium2023-05-03
CVE-2023-2138 Use of Hard-coded Credentials in nuxtlabs/github-module — nuxtlabs/github-module 9.8 -2023-04-18
CVE-2023-28503 Authentication bypass in UniRPC's udadmin service — UniData 9.8 -2023-03-29
CVE-2022-22512 VARTA: Multiple devices prone to hard-coded credentials — Element backup 9.8 Critical2023-03-23
CVE-2023-1269 Use of Hard-coded Credentials in alextselegidis/easyappointments — alextselegidis/easyappointments 9.8 -2023-03-08
CVE-2023-25823 Gradio contains Use of Hard-coded Credentials — gradio 5.4 Medium2023-02-23
CVE-2022-3089 EnOcean SmartServer Hard-coded credentials — Smartserver 6.3 Medium2023-02-13
CVE-2022-34449 Dell PowerPath Management Appliance 信任管理问题漏洞 — PowerPath Management Appliance 6.0 Medium2023-02-10
CVE-2023-21426 SAMSUNG Mobile devices 信任管理问题漏洞 — Samsung Mobile Devices 4.3 Medium2023-02-09
CVE-2022-42973 Schneider Electric Easy UPS Online Monitoring Software 信任管理问题漏洞 — APC Easy UPS Online Monitoring Software 7.8 High2023-02-01
CVE-2023-21524 Windows Local Security Authority (LSA) Elevation of Privilege Vulnerability — Windows 10 Version 1809 7.8 High2023-01-10
CVE-2022-3928 Hardcoded credential is found in the message queue — FOXMAN-UN 7.1 High2023-01-05
CVE-2022-3927 The affected products store public and private key that are used to sign and protect custom parameter set files from modification. — FOXMAN-UN 8.0 High2023-01-05
CVE-2021-40342 Use of default key for encryption — FOXMAN-UN 7.1 High2023-01-05
CVE-2023-22463 KubePi's Hardcoded Jwtsigkeys allows malicious actor to login with a forged JWT token — KubePi 9.8 -2023-01-04
CVE-2022-47618 Merit Lilin Ent. Co., Ltd. AH55B04 & AH55B08 DVR - Hard-coded Credentials — AH55B04 DVR firmware 9.8 Critical2023-01-03
CVE-2022-4611 Click Studios Passwordstate hard-coded credentials — Passwordstate 4.3 Medium2022-12-19
CVE-2021-35252 Common Key Vulnerability in Serv-U FTP Server — Serv-U FTP Server 7.5 High2022-12-16
CVE-2022-40259 MegaRAC Default Credentials Vulnerability — MegaRAC SPx12 8.3 High2022-12-05
CVE-2022-40242 MegaRAC Default Credentials Vulnerability — MegaRAC SPx12 7.5 High2022-12-05
CVE-2022-32967 Realtek RTL8111EP-CG/RTL8111FP-CG - Use of Hard-coded Credentials — RTL8111EP-CG 2.1 Low2022-11-29
CVE-2022-41157 ERP solution Remote Code Execution Vulnerability — sERP Server 2.0 8.1 High2022-11-25
CVE-2021-34577 Hardcoded credentials in Kaden PICOFLUX AiR — PICOFLUX AiR 6.5 Medium2022-11-09
CVE-2022-40263 BD Totalys MultiProcessor - Hardcoded Credentials — BD Totalys MultiProcessor 6.6 Medium2022-11-04
CVE-2022-29889 Abode Iota 信任管理问题漏洞 — iota All-In-One Security Kit 9.8 -2022-10-25

Vulnerabilities classified as CWE-798 (使用硬编码的凭证) represent 559 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.