CWE-522: Insufficiently Protected Credentials

What is CWE-522?

CWE-522 is Insufficiently Protected Credentials. The flaw arises when the product transmits or stores authentication credentials using an insecure method that is susceptible to unauthorized interception or retrieval.

OWASP TOP 10:2025 RANK6 — A06:2025 — Insecure Design
Related CVES (365 days)-
AbstractionClass
Likelihood of exploit-

No data

No vulnerability data for CWE-522

No data

No vulnerability data in CISA KEV for CWE-522

Official definition

ByMitre CWE

The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.

Detailed description

This weakness occurs when authentication credentials are not adequately protected while being transmitted or stored. An attacker may obtain them from a communication channel, configuration file, memory, or serialization mechanism, or exploit an unsafe verification design to impersonate a user. Plaintext transmission or storage, simple transformations, replayable hashes, and predictable values can all leave credentials exposed and undermine authentication and access control.

Characteristics

This weakness can arise during both architecture and design and implementation, and it is not specific to a programming language or technology. It covers several forms of inadequate protection, including plaintext transmission or storage, weak transformations or hashes, secrets placed in configuration files, and unsafe handling of untrusted serialized data. The defining characteristic is that the protection mechanism does not adequately prevent interception, retrieval, disclosure, or misuse of authentication credentials.

Common consequences

The primary consequence is an access-control failure: an attacker may gain access to user accounts or assume user identities. This can provide access to sensitive data available to those accounts and may permit unauthorized actions when the exposed credentials or authentication mechanism has sufficient privileges.

ImpactScopeExplanation
Gain Privileges or Assume IdentityAccess ControlAn attacker could gain access to user accounts and access sensitive data used by the user accounts.

Risk mitigations

During architecture and design, select an appropriate security mechanism for protecting credentials and use cryptography appropriately. During implementation, apply established industry standards for credential protection, such as LDAP or a keystore, where suitable.

  1. Architecture and DesignUse an appropriate security mechanism to protect the credentials.
  2. Architecture and DesignMake appropriate use of cryptography to protect the credentials.
  3. ImplementationUse industry standards to protect the credentials (e.g. LDAP, keystore, etc.).

Detection methods

Automated static analysis, commonly called Static Application Security Testing (SAST), can find some instances by analyzing source or binary code without execution. It typically models data flow and control flow, then searches for potentially vulnerable patterns connecting sources with sinks where data reaches external components or lower layers. Coverage depends on whether the analysis recognizes the relevant credential sources, sinks, and protection logic, so it cannot guarantee detection of every instance.

MethodApproachEffectiveness
Automated Static AnalysisAutomated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)High

Representative vulnerabilities

The official record provides the following curated representative examples, not an exhaustive list:

  • CVE-2022-30018: a messaging platform serializes complete User/Group objects, exposing private information.
  • CVE-2022-29959: an initialization file contains credentials that can be decoded using a simple string transformation.
  • CVE-2022-35411: a Python-based RPC framework enables pickle functionality by default, allowing clients to unpickle untrusted data.
  • CVE-2022-29519, CVE-2022-30312, and CVE-2022-31204: industrial controllers transmit sensitive information, authentication credentials, or passwords in plaintext.
  • CVE-2022-30275: an RTU uses a driver that stores a password in plaintext.
  • CVE-2007-0681 and CVE-2000-0944: password-change functionality does not require or verify the original password, enabling unauthorized changes.
  • CVE-2005-3435: authentication relies on a user-supplied MD5 hash matching the database value and can be subject to replay attacks.
  • CVE-2005-0408: the product generates predictable MD5 hashes from a constant combined with the username, enabling authentication bypass.
Sources (2)

CWE™ Program, operated by The MITRE Corporation. Copyright © 2006–2026, The MITRE Corporation. The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. CWE Terms of Use.

Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.