---
title: "CWE-257: Storing Passwords in a Recoverable Format"
url: https://radicalnotion.ai/cwe/cwe-257
type: cwe
description: "The storage of passwords in a recoverable format makes them subject to password reuse attacks by malicious users. In fact, it should be noted that recoverable encrypted passwords provide no significant benefit over plaintext passwords since they are subject not only to reuse by malicious attackers but also by malicious insiders. If a system administrator can recover a password directly, or use a brute force search on the available information, the administrator can use the password on other accounts."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-257: Storing Passwords in a Recoverable Format

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **Likelihood of exploit:** High
- **CVEs with this as primary weakness:** 68
- **Of those, in CISA KEV:** 1
- **New in 2026:** 15
- **CWE catalog version:** 4.21

## Description

The storage of passwords in a recoverable format makes them subject to password reuse attacks by malicious users. In fact, it should be noted that recoverable encrypted passwords provide no significant benefit over plaintext passwords since they are subject not only to reuse by malicious attackers but also by malicious insiders. If a system administrator can recover a password directly, or use a brute force search on the available information, the administrator can use the password on other accounts.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | COMMISSION: This weakness refers to an incorrect design related to an architectural security tactic. |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Access Control | Gain Privileges or Assume Identity | User's passwords may be revealed. |
| Access Control | Gain Privileges or Assume Identity | Revealed passwords may be reused elsewhere to impersonate the users in question. |

## Potential mitigations

### Architecture and Design

Use strong, non-reversible encryption to protect stored passwords.

## Detection methods

### Automated Static Analysis

Automated 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.)

Effectiveness: High

## Demonstrative examples

### Example 1

Both of these examples verify a password by comparing it to a stored compressed version.

Bad code:

```c
int VerifyAdmin(char *password) {
    if (strcmp(compress(password), compressed_password)) {
        printf("Incorrect Password!\n");
        return(0);
    }
    printf("Entering Diagnostic Mode...\n");
    return(1);
}
```

Bad code:

```java
int VerifyAdmin(String password) {
    if (passwd.Equals(compress(password), compressed_password)) {
        return(0);
    }
    //Diagnostic Mode
    return(1);
}
```

Because a compression algorithm is used instead of a one way hashing algorithm, an attacker can recover compressed passwords stored in the database.

### Example 2

The following examples show a portion of properties and configuration files for Java and ASP.NET applications. The files include username and password information but they are stored in cleartext.

Bad code:

```java
# Java Web App ResourceBundle properties file
...
webapp.ldap.username=secretUsername
webapp.ldap.password=secretPassword
...
```

Bad code:

```aspnet
...
<connectionStrings>
    <add name="ud_DEV" connectionString="connectDB=uDB; uid=db2admin; pwd=password; dbalias=uDB;" providerName="System.Data.Odbc" />
</connectionStrings>
...
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2022-30018 | A messaging platform serializes all elements of User/Group objects, making private information available to adversaries |

## Real CVEs with this weakness (sample of 12 of 68)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-20128 | Cisco Catalyst SD-WAN Manager Information Disclosure Vulnerability | critical | 9.1 | - | Yes | 2026-02-25 |
| CVE-2023-0353 | CVE-2023-0353 | critical | 9.8 | - | No | 2023-03-13 |
| CVE-2022-32519 | - | critical | 9.8 | - | No | 2023-01-30 |
| CVE-2026-28745 | Red Lion Controls N-Tron 700 Series Storing Passwords in a Recoverable Format | critical | 9.3 | - | No | 2026-10-09 |
| CVE-2025-8095 | Recoverable obfuscation using the OECH1 prefix encoding in OpenEdge | critical | 9.1 | - | No | 2026-04-14 |
| CVE-2025-8904 | Privilege escalation issue in Amazon EMR Secret Agent component | critical | 9.0 | - | No | 2025-08-13 |
| CVE-2016-15058 | Hirschmann HiLCOS Classic Platform Password Exposure via SNMP | high | 8.6 | - | No | 2026-04-03 |
| CVE-2025-34180 | NetSupport Manager \< 14.12.0001 Gateway Key Reversible Encoding Credential Recovery | high | 8.4 | - | No | 2025-12-15 |
| CVE-2025-6996 | Improper Encryption in Ivanti Endpoint Manager | high | 8.4 | - | No | 2025-07-08 |
| CVE-2025-6995 | Improper Encryption in Ivanti Endpoint Manager | high | 8.4 | - | No | 2025-07-08 |
| CVE-2022-34838 | ABB Ability TM Operations Data Management Zenon Zenon Log Server file access control | high | 8.4 | - | No | 2022-08-24 |
| CVE-2026-30785 | RustDesk Encrypts Local Passwords with World-Readable Machine ID and Fixed Zero Nonce (XSalsa20-Poly1305) | high | 8.2 | - | No | 2026-03-05 |

## Related attack patterns (CAPEC)

- [CAPEC-49](https://radicalnotion.ai/capec/capec-49): Password Brute Forcing

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-522](https://radicalnotion.ai/cwe/cwe-522) | Insufficiently Protected Credentials |
| Peer | [CWE-259](https://radicalnotion.ai/cwe/cwe-259) | Use of Hard-coded Password |
| Peer | [CWE-798](https://radicalnotion.ai/cwe/cwe-798) | Use of Hard-coded Credentials |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CLASP | Storing passwords in a recoverable format | - | - |
| Software Fault Patterns | Exposed Data | SFP23 | - |

## Frequently asked questions

### What is CWE-257?

The storage of passwords in a recoverable format makes them subject to password reuse attacks by malicious users. In fact, it should be noted that recoverable encrypted passwords provide no significant benefit over plaintext passwords since they are subject not only to reuse by malicious attackers but also by malicious insiders. If a system administrator can recover a password directly, or use a brute force search on the available information, the administrator can use the password on other accounts.

### What CVEs are caused by CWE-257?

68 recorded CVEs are attributed to CWE-257, including CVE-2026-20128, CVE-2023-0353 and CVE-2022-32519. 1 is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-257?

Use strong, non-reversible encryption to protect stored passwords.

### How is CWE-257 detected?

Automated Static Analysis: Automated 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.)

### What are the consequences of CWE-257?

Exploiting CWE-257 can lead to: Gain Privileges or Assume Identity.

### Is CWE-257 actively exploited?

Yes. 1 CWE-257 vulnerability is in CISA's KEV catalog of actively exploited flaws, out of 68 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/257.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-257). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
