CWE-532: Insertion of Sensitive Information into Log File
The product writes sensitive information to a log file.
Last updated
The product writes sensitive information to a log file.
Last updated
1,242 recorded CVEs are caused by CWE-532 (Insertion of Sensitive Information into Log File), including 2 in CISA's KEV (Known Exploited Vulnerabilities) catalog. KEVs are shown first. 342 new CWE-532 CVEs have been recorded so far in 2026 (167 in 2025).
Samsung Mobile Devices Insertion of Sensitive Information Into Log File Vulnerability
Windows NTFS Information Disclosure Vulnerability
Apache Juneau: Sensitive request headers logged in cleartext by the default request logger on server errors
Acer Wave 7 router: Broken Access Control
Information Exposure Vulnerability in Hitachi Disk Array Systems
check-spelling workflow vulnerable to GITHUB_TOKEN leakage via symlink attack
vLLM leaks a heap address when PIL throws an error
CE21 Suite <= 2.3.1 - Unauthenticated Sensitive Information Exposure to Privilege Escalation
@valtimo/components exposes access token to form.io
Potential unauthorized access to stored request & session data when plugin is misconfigured in October CMS Debugbar
Showing 12 of 1,242 recorded CWE-532 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor these CVEsWhat can happen when CWE-532 is exploited.
Read Application Data
Affects: Confidentiality
Logging sensitive user data, full path names, or system information often provides attackers with an additional, less-protected path to acquiring the information.
Typically introduced during these phases of the software lifecycle.
Languages
Practical mitigations for CWE-532, grouped by where in the lifecycle they apply.
Consider seriously the sensitivity of the information written into log files. Do not write secrets into the log files.
Remove debug log files before deploying the application into production.
Protect log files against unauthorized read/write.
Adjust configurations appropriately when software is transitioned from a debug state to production.
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
MITRE examples of the weakness in code.
In the following code snippet, a user's full name and credit card number are written to a log file.
Vulnerable example
logger.info("Username: " + usernme + ", CCN: " + ccn);This code stores location information about the current user:
Vulnerable example
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.
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.
Vulnerable example
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;
}Real CVEs that MITRE cites as examples of this weakness.
CAPEC attack patterns that exploit this weakness.
Common questions about CWE-532.
Weakness data is sourced from the MITRE CWE catalog (v4.21). CVE associations are aggregated and kept current by RadicalNotion.AI.
Get an alert when a new CWE-532 CVE affects your products, with AI-written analysis and remediation steps.
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.