---
title: "CWE-526: Cleartext Storage of Sensitive Information in an Environment Variable"
url: https://radicalnotion.ai/cwe/cwe-526
type: cwe
description: "The product uses an environment variable to store unencrypted sensitive information."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-526: Cleartext Storage of Sensitive Information in an Environment Variable

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

## Description

The product uses an environment variable to store unencrypted sensitive information.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |
| Implementation | - |
| Operation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality | Read Application Data | Information stored in an environment variable might be accessible by other processes with the execution context, including child processes that dependencies are executed in, or serverless functions in cloud environments. An environment variable's contents can also be inserted into messages, headers, log files, or other outputs. Often these other dependencies have no need to use the environment variable in question. A weakness that discloses environment variables could expose this information. |

## Potential mitigations

### Architecture and Design

Encrypt information stored in the environment variable to protect it from being exposed to an unauthorized user. If encryption is not feasible or is considered too expensive for the business use of the application, then consider using a properly protected configuration file instead of an environment variable. It should be understood that unencrypted information in a config file is also not guaranteed to be protected, but it is still a better choice, because it reduces attack surface related to weaknesses such as CWE-214. In some settings, vaults might be a feasible option for safer data transfer. Users should be notified of the business choice made to not protect the sensitive information through encryption.

### Implementation

If the environment variable is not necessary for the desired behavior, then remove it entirely, or clear it to an empty value.

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

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2022-43691 | CMS shows sensitive server-side information from environment variables when run in Debug mode. |
| CVE-2022-27195 | Plugin for an automation server inserts environment variable contents into build XML files. |
| CVE-2022-25264 | CI/CD tool logs environment variables related to passwords add Contribution to content history. |

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-54146 | OpenHuman: Bearer token leak via process environment variable on macOS (same-UID local RCE primitive) | high | 8.8 | - | No | 2026-11-05 |
| CVE-2026-45370 | python-utcp: Full Process Environment Exposed to CLI Subprocess - Secrets Leakage via Command Injection | high | 7.7 | - | No | 2026-05-14 |
| CVE-2023-5720 | Quarkus: build env information disclosure via gradle plugin | high | 7.7 | - | No | 2023-11-15 |
| CVE-2026-100975 | OpenShell: OpenShell: Unauthorized sandbox access via plaintext SSH secret | high | 7.6 | - | No | 2026-11-17 |
| CVE-2025-28381 | - | high | 7.5 | - | No | 2025-06-13 |
| CVE-2023-43029 | IBM Storage Virtualize vSphere Remote Plug-in information disclosure | high | 7.5 | - | No | 2025-03-21 |
| CVE-2026-40153 | PraisonAIAgents Affected by Environment Variable Secret Exfiltration via os.path.expandvars() Bypassing shell=False in Shell Tool | high | 7.4 | - | No | 2026-04-09 |
| CVE-2026-77938 | Letta through 0.16.8 Credential Exposure via Tool Sandbox Environment Inheritance | high | 7.1 | - | No | 2026-10-20 |
| CVE-2024-2700 | Quarkus-core: leak of local configuration properties into quarkus applications | high | 7.0 | - | No | 2024-04-04 |
| CVE-2026-76227 | Renovate 42.68.1 before 42.96.3 and 43.0.0 before 43.4.4 Environment Variable Exposure | medium | 6.8 | - | No | 2026-08-19 |
| CVE-2024-4369 | Cluster-image-registry-operator: exposes a secret via env variable in pod definition on azure | medium | 6.8 | - | No | 2024-04-30 |
| CVE-2026-72648 | Cleartext Storage of Sensitive Information in an Environment Variable in Elastic Cloud on Kubernetes Leading to Information Disclosure | medium | 6.5 | - | No | 2026-08-13 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-312](https://radicalnotion.ai/cwe/cwe-312) | Cleartext Storage of Sensitive Information |
| Peer | [CWE-214](https://radicalnotion.ai/cwe/cwe-214) | Invocation of Process Using Visible Sensitive Information |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| Software Fault Patterns | Exposed Data | SFP23 | - |

## Frequently asked questions

### What is CWE-526?

The product uses an environment variable to store unencrypted sensitive information.

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

26 recorded CVEs are attributed to CWE-526, including CVE-2026-54146, CVE-2026-45370 and CVE-2023-5720.

### How do you prevent CWE-526?

Encrypt information stored in the environment variable to protect it from being exposed to an unauthorized user. If encryption is not feasible or is considered too expensive for the business use of the application, then consider using a properly protected configuration file instead of an environment variable. It should be understood that unencrypted information in a config file is also not guaranteed to be protected, but it is still a better choice, because it reduces attack surface related to weaknesses such as CWE-214. In some settings, vaults might be a feasible option for safer data transfer. Users should be notified of the business choice made to not protect the sensitive information through encryption.

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

Exploiting CWE-526 can lead to: Read Application Data.

### Is CWE-526 actively exploited?

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

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

---

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