---
title: "CWE-532: Insertion of Sensitive Information into Log File"
url: https://radicalnotion.ai/cwe/cwe-532
type: cwe
description: "The product writes sensitive information to a log file."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-532: Insertion of Sensitive Information into Log File

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

## Description

The product writes sensitive information to a log file.

## Modes of introduction

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

## Applicable platforms

**Languages:** Go (Undetermined), Python (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality | Read Application Data | Logging sensitive user data, full path names, or system information often provides attackers with an additional, less-protected path to acquiring the information. |

## Potential mitigations

### Architecture and Design, Implementation

Consider seriously the sensitivity of the information written into log files. Do not write secrets into the log files.

### Distribution

Remove debug log files before deploying the application into production.

### Operation

Protect log files against unauthorized read/write.

### Implementation

Adjust configurations appropriately when software is transitioned from a debug state to production.

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

In the following code snippet, a user's full name and credit card number are written to a log file.

Bad code:

```java
logger.info("Username: " + usernme + ", CCN: " + ccn);
```

### Example 2

This code stores location information about the current user:

Bad code:

```java
locationClient = new LocationClient(this, this, this);
locationClient.connect();
currentUser.setLocation(locationClient.getLastLocation());
...

catch (Exception e) {
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setMessage("Sorry, this application has experienced an error.");
    AlertDialog alert = builder.create();
    alert.show();
    Log.e("ExampleActivity", "Caught exception: " + e + " While on User:" + User.toString());
}
```

When the application encounters an exception it will write the user object to the log. Because the user object contains location information, the user's location is also written to the log.

### Example 3

In the example below, the method getUserBankAccount retrieves a bank account object from a database using the supplied username and account number to query the database. If an SQLException is raised when querying the database, an error message is created and output to a log file.

Bad code:

```java
public BankAccount getUserBankAccount(String username, String accountNumber) {
    BankAccount userAccount = null;
    String query = null;
    try {
        if (isAuthorizedUser(username)) {
            query = "SELECT * FROM accounts WHERE owner = "
            + username + " AND accountID = " + accountNumber;
            DatabaseManager dbManager = new DatabaseManager();
            Connection conn = dbManager.getConnection();
            Statement stmt = conn.createStatement();
            ResultSet queryResult = stmt.executeQuery(query);
            userAccount = (BankAccount)queryResult.getObject(accountNumber);
        }
    } catch (SQLException ex) {
        String logMessage = "Unable to retrieve account information from database,\nquery: " + query;
        Logger.getLogger(BankManager.class.getName()).log(Level.SEVERE, logMessage, ex);
    }
    return userAccount;
}
```

The error message that is created includes information about the database query that may contain sensitive information about the database or query logic. In this case, the error message will expose the table name and column names used in the database. This data could be used to simplify other attacks, such as SQL injection (CWE-89) to directly access the database.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2017-9615 | verbose logging stores admin credentials in a world-readable log file |
| CVE-2018-1999036 | SSH password for private key stored in build log |

## Real CVEs with this weakness (sample of 12 of 1,233)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2023-21492 | Samsung Mobile Devices Insertion of Sensitive Information Into Log File Vulnerability | medium | 6.7 | - | Yes | 2023-05-04 |
| CVE-2025-24984 | Windows NTFS Information Disclosure Vulnerability | medium | 5.1 | - | Yes | 2025-03-11 |
| CVE-2026-73100 | Apache Juneau: Sensitive request headers logged in cleartext by the default request logger on server errors | critical | 10.0 | - | No | 2026-11-05 |
| CVE-2026-49200 | Acer Wave 7 router: Broken Access Control | critical | 10.0 | - | No | 2026-05-29 |
| CVE-2022-36407 | Information Exposure Vulnerability in Hitachi Disk Array Systems | critical | 9.9 | - | No | 2024-03-25 |
| CVE-2021-32724 | check-spelling workflow vulnerable to GITHUB\_TOKEN leakage via symlink attack | critical | 9.9 | - | No | 2021-09-09 |
| CVE-2026-22778 | vLLM leaks a heap address when PIL throws an error | critical | 9.8 | - | No | 2026-02-02 |
| CVE-2025-11008 | CE21 Suite \<= 2.3.1 - Unauthenticated Sensitive Information Exposure to Privilege Escalation | critical | 9.8 | - | No | 2025-11-04 |
| CVE-2024-34706 | @valtimo/components exposes access token to form.io | critical | 9.8 | - | No | 2024-05-13 |
| CVE-2021-37759 | - | critical | 9.8 | - | No | 2021-07-31 |
| CVE-2021-37760 | - | critical | 9.8 | - | No | 2021-07-31 |
| CVE-2020-11094 | Potential unauthorized access to stored request & session data when plugin is misconfigured in October CMS Debugbar | critical | 9.8 | - | No | 2020-06-03 |

## Related attack patterns (CAPEC)

- [CAPEC-215](https://radicalnotion.ai/capec/capec-215): Fuzzing for application mapping

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-200](https://radicalnotion.ai/cwe/cwe-200) | Exposure of Sensitive Information to an Unauthorized Actor |
| Parent | [CWE-538](https://radicalnotion.ai/cwe/cwe-538) | Insertion of Sensitive Information into Externally-Accessible File or Directory |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| The CERT Oracle Secure Coding Standard for Java (2011) | Do not log sensitive information outside a trust boundary | FIO13-J | - |
| Software Fault Patterns | Exposed Data | SFP23 | - |
| OpenSSF Secure Coding Guide for Python | Exclude Sensitive Data From Logs | pyscg-0019 | - |
| OWASP Golang Secure Coding Practices Guide | Error Handling and Logging | - | - |

## Frequently asked questions

### What is CWE-532?

The product writes sensitive information to a log file.

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

1,233 recorded CVEs are attributed to CWE-532, including CVE-2023-21492, CVE-2025-24984 and CVE-2026-73100. 2 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

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

CWE-532 maps to OWASP Golang Secure Coding Practices Guide: Error Handling and Logging in the OWASP security taxonomy.

### How do you prevent CWE-532?

Consider seriously the sensitivity of the information written into log files. Do not write secrets into the log files.

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

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

### Is CWE-532 actively exploited?

Yes. 2 CWE-532 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 1,233 recorded CVEs.

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

---

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