- What is CWE-526?
- The product uses an environment variable to store unencrypted sensitive information.
- What CVEs are caused by CWE-526?
- 18 recorded CVEs are attributed to CWE-526, including CVE-2026-45370, CVE-2023-5720, CVE-2025-28381.
- 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?
- 18 recorded CVEs are caused by CWE-526; none are currently in CISA's KEV catalog of actively exploited flaws.