Skip to content
Info disclosure Disclosed report Beginner

Attacker can read password from log data

The application writes user passwords in plain text to a temporary Tomcat log file on disk. An attacker with access to that file could read the passwords.

Amir Ahmadi Follow

Originally disclosed on HackerOne

Bounty$168 Low View original
  • Disclosed after 2 months

Summary:

Attacker can read plain text password from log data.

Steps To Reproduce:

  1. From application dashboard choose Users section, I simultaneously ran process hacker to see the process disk write and read behavior.
  2. change the password of one of the users, and you see in process hacker window the place for log data creation.
  3. Open the file in favorite editor in that place:

%UserProfile%\AppData\Local\Temp\tomcat.1470616378544174392.8080\work\Tomcat\localhost\midpoint

Supporting Material/References:

I have uploaded a video for POC.

Impact

Attacker can read plain text password from log data.

Attachments

PlainText.mp4 From the original on HackerOne

The original report as published on HackerOne, by kingamir. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is the Midpoint identity management platform, hosted on GitHub at https://github.com/evolveum/midpoint. The researcher reported that an attacker can read a plaintext password from log data written by the application.

The reproduction is short and relies on watching the filesystem while the application handles a password change:

  1. From the application dashboard, open the Users section. At the same time, run Process Hacker to observe the process disk write and read behaviour.
  2. Change the password of one of the users. In the Process Hacker window you can see where the log data is created.
  3. Open the file in your favourite editor at that location:
Text
%UserProfile%\AppData\Local\Temp\tomcat.1470616378544174392.8080\work\Tomcat\localhost\midpoint

The path is a Tomcat working directory under the user's temporary folder, and the file named midpoint is where the sensitive data ends up. The researcher recorded a proof of concept video, which is the only supporting material attached to the report.

PlainText.mp4 From the original on HackerOne

The video, titled PlainText.mp4, is the proof of concept attached to the report.

The report was rated low severity, classified as plaintext storage of a password, and paid a bounty of 168.00 USD. It was disclosed on 15 June 2019. The report does not describe a fix.

Root cause

The report does not identify the cause; it only shows where the resulting file lives. Logging frameworks commonly serialise request parameters, form bodies or object state at debug level, and a password field that is not masked will be captured verbatim. The report itself does not identify the logging statement or the component responsible; it only shows where the resulting file lives.

Impact

As the report puts it, an attacker can read a plaintext password from log data. The report does not analyse who can read that file, so the impact statement stays at the level of the disclosure itself. The report does not analyse those access paths, so the impact statement stays at the level of the disclosure itself.

How this kind of bug works

Sensitive values end up in logs when an application records more than it needs. Typical mechanisms:

  • Request or response bodies are logged in full at debug or trace level, including form fields such as password, newPassword or confirmPassword.
  • Object serialisation (for example a toString() on a user or credential object) includes the password property.
  • Exception handlers dump the arguments of the failing call, and a credential is among them.
  • Framework or container output writes data to a file in a working directory, which is where the file was found here.

The bug class matters because logs travel: they are copied to central collectors, rotated into archives, included in support bundles and kept far longer than the request itself. A password that is masked in the UI but written unmasked to disk is exposed to everyone who can read the log store, which is usually a much wider group than those who can read the database.

Defences are straightforward in principle: never log credential fields, apply allowlists of loggable parameters rather than denylists, mask known sensitive keys at the logging layer, and keep debug logging off in production. The failure mode is that masking is applied in one code path and forgotten in another, so the control has to sit centrally.

How to test for it

This is a local or grey-box test as much as a remote one, because the evidence usually sits on the server filesystem.

  1. Identify every flow that handles a secret: login, password change, password reset, API token creation, MFA enrolment.
  2. Perform the flow with a unique marker value as the password, for example a long random string you can search for later. A unique value makes grepping reliable and avoids matching unrelated text.
  3. Obtain access to the log output. If you have shell access to the host, watch the filesystem while the request runs, as the researcher did with Process Hacker, and inspect the application log directory, the servlet container's work and temp directories, and any configured log path.
  4. Search the logs for the marker. A positive result is the exact marker appearing in clear text in a file written as a consequence of your request.
  5. If you have no host access, look for features that expose logs to users: admin log viewers, downloadable diagnostics or support bundles, error pages that echo request state, and debug endpoints.

Common false positives: the marker appearing in a URL or referrer that you yourself supplied, the value showing up in your own browser's developer tools rather than server-side storage, or a masked value that merely resembles the secret. Confirm the file is written by the server and persists after the request completes.

How it is fixed

  • Remove credential fields from all log statements and from any object serialisation used for logging.
  • Apply masking centrally in the logging configuration so that known sensitive keys are redacted regardless of the call site.
  • Restrict logging of request bodies to an allowlist of fields.
  • Ensure production configurations do not enable debug or trace logging for request handling.
  • Treat the exposed credentials as compromised: force a reset for affected accounts and purge the affected log files.

Hunting notes

Log-based credential leaks hide wherever the application is verbose: authentication and account management endpoints, admin consoles, import and provisioning jobs, and integration endpoints that echo configuration. Servlet containers are a good place to look, because their work directories and access logs are often overlooked and are frequently included in backups.

Recon signals worth following: applications that ship with debug logging enabled, stack traces returned to clients, admin panels with log viewers, and support or diagnostic download features. On hosts you can access, a quick search of the log and temp directories for common field names is cheap and often productive.

To make the report land, show the exact file path, the request that caused the write, and the secret in clear text, and explain who can read that path. A unique marker value tied to your own test account keeps the demonstration clean and avoids exposing a real user's credential.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

Midpoint is an identity management platform: software that organisations use to keep track of user accounts and their credentials in one place. The researcher reported that the application writes a user's password into log data on disk in readable form, so anyone who can open that file can read the password.

A log file is a running record that a program keeps of what it did, a bit like a diary. Programs write logs so that administrators can later work out what went wrong. The problem here is that the diary contains something it should never contain: the password itself, in plain text.

The researcher did not attack the application from the outside. Instead, they watched the server's own disk while using the application normally, and found the password sitting in a file the application had written.

How the researcher reproduced it

The reproduction is short. It relies on watching the filesystem while the application handles a password change.

  1. From the application dashboard, open the Users section. At the same time, run Process Hacker to observe the process disk write and read behaviour.
  2. Change the password of one of the users. In the Process Hacker window you can see where the log data is created.
  3. Open the file in your favourite editor at that location:
Text
%UserProfile%\AppData\Local\Temp\tomcat.1470616378544174392.8080\work\Tomcat\localhost\midpoint

Process Hacker is a free tool for Windows that shows what programs on the computer are doing, including which files they read and write. It is the equivalent of standing behind someone and watching which drawer they open. Running it alongside a password change is what makes the hidden file visible: without it, you would have no reason to look in that folder.

Changing a user's password is the action that triggers the problem. The password is the secret being handled, so it is exactly the moment when you want to check whether the secret leaks somewhere it should not.

The path in step 3 is where the sensitive data ends up. Read from left to right:

  • %UserProfile% is a Windows shorthand for the current user's home folder.
  • AppData\Local\Temp is the temporary folder inside it, where programs put scratch files.
  • tomcat.1470616378544174392.8080 is a working folder created by Tomcat, the Java web server that runs the application. The long number is part of the folder name Tomcat generates.
  • work\Tomcat\localhost\midpoint is the file itself, inside Tomcat's working area for the local site.

So the password is written into a file in a temporary directory rather than kept only where credentials belong.

The researcher recorded a proof of concept video, which is the only supporting material attached to the report.

PlainText.mp4 From the original on HackerOne

The video, titled PlainText.mp4, is the proof of concept attached to the report.

The report was rated low severity, classified as plaintext storage of a password, and paid a bounty of 168.00 USD. It was disclosed on 15 June 2019. The report does not describe a fix.

Why it matters

The report's impact statement is one line: an attacker can read a plaintext password from log data. The report does not analyse who can read the file, so the impact stays at the level of the disclosure itself. The report does not analyse those access paths, so the impact stays at the level of the disclosure itself.

The reason this is worth reporting even at low severity is that logs travel. They get copied to central collectors, rotated into archives, attached to support bundles and kept far longer than the request that produced them. A password that is hidden behind dots in the user interface but written unmasked to disk is exposed to everyone who can read the log store, which is usually a much wider group than those who can read the database.

In general, how this kind of bug works

Sensitive values end up in logs when an application records more than it needs. Typical mechanisms:

  • Request or response bodies are logged in full at debug or trace level, including form fields such as password, newPassword or confirmPassword.
  • Object serialisation (for example a toString() on a user or credential object) includes the password property.
  • Exception handlers dump the arguments of the failing call, and a credential is among them.
  • Framework or container output writes data to a file in a working directory, which is where the file was found here.

Debug logging is a mode where the program records far more detail than usual, for the benefit of developers. It is like a shop that keeps a camera running in the stockroom: useful while setting things up, but you would not leave the footage lying around afterwards.

Defences are straightforward in principle: never log credential fields, apply allowlists of loggable parameters rather than denylists, mask known sensitive keys at the logging layer, and keep debug logging off in production. The failure mode is that masking is applied in one code path and forgotten in another, so the control has to sit centrally.

In general, how to test for it

This is a local or grey-box test as much as a remote one, because the evidence usually sits on the server filesystem. Grey-box means you have some access to the inside of the system, not just the web page.

  1. Identify every flow that handles a secret: login, password change, password reset, API token creation, MFA enrolment.
  2. Perform the flow with a unique marker value as the password, for example a long random string you can search for later. A unique value makes searching reliable and avoids matching unrelated text.
  3. Obtain access to the log output. If you have shell access to the host, watch the filesystem while the request runs, as the researcher did with Process Hacker, and inspect the application log directory, the servlet container's work and temp directories, and any configured log path.
  4. Search the logs for the marker. A positive result is the exact marker appearing in clear text in a file written as a consequence of your request.
  5. If you have no host access, look for features that expose logs to users: admin log viewers, downloadable diagnostics or support bundles, error pages that echo request state, and debug endpoints.

Common false positives: the marker appearing in a URL or referrer that you yourself supplied, the value showing up in your own browser's developer tools rather than server-side storage, or a masked value that merely resembles the secret. Confirm the file is written by the server and persists after the request completes.

In general, how it is fixed

  • Remove credential fields from all log statements and from any object serialisation used for logging.
  • Apply masking centrally in the logging configuration so that known sensitive keys are redacted regardless of the call site.
  • Restrict logging of request bodies to an allowlist of fields.
  • Ensure production configurations do not enable debug or trace logging for request handling.
  • Treat the exposed credentials as compromised: force a reset for affected accounts and purge the affected log files.

In general, where to look

Log-based credential leaks hide wherever the application is verbose: authentication and account management endpoints, admin consoles, import and provisioning jobs, and integration endpoints that echo configuration. Servlet containers are a good place to look, because their work directories and access logs are often overlooked and are frequently included in backups.

Recon signals worth following: applications that ship with debug logging enabled, stack traces returned to clients, admin panels with log viewers, and support or diagnostic download features. On hosts you can access, a quick search of the log and temp directories for common field names is cheap and often productive.

To make the report land, show the exact file path, the request that caused the write, and the secret in clear text, and explain who can read that path. A unique marker value tied to your own test account keeps the demonstration clean and avoids exposing a real user's credential.

Glossary

  • Midpoint: an identity management platform, software for managing user accounts and their credentials.
  • Log file: a record a program keeps of what it did, written to disk for later inspection.
  • Plaintext: data stored in readable form, not scrambled or encrypted.
  • Process Hacker: a Windows tool that shows what running programs are doing, including which files they read and write.
  • Tomcat: a Java web server that runs web applications and keeps working folders for them.
  • Working directory: a scratch folder a server uses while running, separate from the application's real data.
  • Temporary folder: a folder for short-lived scratch files, here AppData\Local\Temp under the user's home folder.
  • Debug logging: a verbose logging mode that records far more detail than normal, intended for developers.
  • Serialisation: turning an object in a program into text or bytes, for example to write it to a log.
  • Allowlist: a list of things that are permitted, with everything else refused by default.
  • Denylist: a list of things that are forbidden, with everything else permitted by default.
  • Masking: replacing part of a sensitive value with characters such as asterisks so it cannot be read.
  • Grey-box test: a test where you have some access to the inside of the system, not just its public web page.
  • False positive: a finding that looks like a problem but is not one.
  • Proof of concept: a demonstration that a reported problem really occurs.
  • Bounty: a payment made to a researcher for reporting a valid security problem.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.