---
title: "CWE-261: Weak Encoding for Password"
url: https://radicalnotion.ai/cwe/cwe-261
type: cwe
description: "The product uses a weak or trivial encoding for a password."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-261: Weak Encoding for Password

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 44
- **Of those, in CISA KEV:** 0
- **New in 2026:** 11
- **CWE catalog version:** 4.21

## Description

The product uses a weak or trivial encoding for a password.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | Password management issues occur when a password is stored in plaintext in an application's properties or configuration file. A programmer can attempt to remedy the password management problem by obscuring the password with an encoding function, such as base64 encoding, but this effort does not adequately protect the password. |
| Architecture and Design | COMMISSION: This weakness refers to an incorrect design related to an architectural security tactic. |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control | Gain Privileges or Assume Identity | - |

## Potential mitigations

### Mitigation

Passwords should be encrypted with keys that are at least 128 bits in length for adequate security.

## 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

The following code reads a password from a properties file and uses the password to connect to a database.

Bad code:

```java
...
Properties prop = new Properties();
prop.load(new FileInputStream("config.properties"));
String password = Base64.decode(prop.getProperty("password"));
DriverManager.getConnection(url, usr, password);
...
```

This code will run successfully, but anyone with access to config.properties can read the value of password and easily determine that the value has been base 64 encoded. If a devious employee has access to this information, they can use it to break into the system.

### Example 2

The following code reads a password from the registry and uses the password to create a new network credential.

Bad code:

```c#
...
string value = regKey.GetValue(passKey).ToString();
byte[] decVal = Convert.FromBase64String(value);
NetworkCredential netCred = newNetworkCredential(username,decVal.toString(),domain);
...
```

This code will run successfully, but anyone who has access to the registry key used to store the password can read the value of password. If a devious employee has access to this information, they can use it to break into the system.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2022-45099 | network attached storage (NAS) product uses weak encoding for a password |

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2021-21507 | - | critical | 9.8 | - | No | 2021-04-30 |
| CVE-2020-10275 | RVD#2565: Weak token generation for the REST API. | critical | 9.8 | - | No | 2020-06-24 |
| CVE-2017-7905 | Weak Encoding for Password in GE Multilin SR, UR, and URplus Protective Relays | critical | 9.8 | - | No | 2017-06-30 |
| CVE-2025-31229 | iOS and iPadOS: Accessibility - Passcode may be read aloud by VoiceOver | critical | 9.1 | - | No | 2025-07-29 |
| CVE-2024-45394 | Secret encryption vulnerable to brute-force attacks | high | 8.8 | - | No | 2024-09-03 |
| CVE-2024-24279 | - | high | 8.8 | - | No | 2024-04-08 |
| CVE-2025-11500 | Credentials exposure in tinycontrol devices | high | 8.7 | - | No | 2026-03-16 |
| CVE-2024-45273 | MB connect line/Helmholz: Weak encryption of configuration file | high | 8.4 | - | No | 2024-10-15 |
| CVE-2024-7407 | Weak password encoding in Streamsoft Prestiż | high | 8.2 | - | No | 2025-03-28 |
| CVE-2024-8455 | PLANET Technology switch devices - Swctrl service exchanges weakly encoded passwords | high | 8.1 | - | No | 2024-09-30 |
| CVE-2024-28270 | - | high | 8.1 | - | No | 2024-04-08 |
| CVE-2022-45099 | - | high | 7.8 | - | No | 2023-02-01 |

## Related attack patterns (CAPEC)

- [CAPEC-55](https://radicalnotion.ai/capec/capec-55): Rainbow Table Password Cracking

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-522](https://radicalnotion.ai/cwe/cwe-522) | Insufficiently Protected Credentials |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| 7 Pernicious Kingdoms | Password Management: Weak Cryptography | - | - |
| OWASP Top Ten 2004 | Insecure Storage | A8 | CWE More Specific |

## Frequently asked questions

### What is CWE-261?

The product uses a weak or trivial encoding for a password.

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

44 recorded CVEs are attributed to CWE-261, including CVE-2021-21507, CVE-2020-10275 and CVE-2017-7905.

### Is CWE-261 part of the OWASP Top 10?

CWE-261 maps to OWASP Top Ten 2004: Insecure Storage (A8) in the OWASP security taxonomy.

### How do you prevent CWE-261?

Passwords should be encrypted with keys that are at least 128 bits in length for adequate security.

### How is CWE-261 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-261?

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

### Is CWE-261 actively exploited?

44 recorded CVEs are caused by CWE-261; none are currently in CISA's KEV catalog of actively exploited flaws.

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

---

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