Bug 61114 - startup.VersionLoggerListener may leak sensitive information
Summary: startup.VersionLoggerListener may leak sensitive information
Status: RESOLVED WONTFIX
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.28
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-22 14:16 UTC by jhermann
Modified: 2017-05-23 11:36 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jhermann 2017-05-22 14:16:28 UTC
Related to https://bz.apache.org/bugzilla/show_bug.cgi?id=56401

When passwords or similar are part of the JVM command line, they end up in logs that might be shipped to locations where you don't want that information to end up in. At least well-known cases should be handled (-Djavax.net.ssl.trustStorePassword=...).

Possible remedies:
* Provide an option to not log command line args (but the other information).
* Handle well-known cases via a blacklist of substrings / regex that prevent logging ("javax.net.ssl.trustStorePassword", or "password" and "secret" in general).

Or course, removing the listener also works, but at the price of removing *all* of its logging.
Comment 1 Konstantin Kolinko 2017-05-22 20:38:51 UTC
1. The option already exists. Looking at the oldest version supported now (7.0.x), it is named "logArgs", in all newer versions as well.

http://tomcat.apache.org/tomcat-7.0-doc/config/listeners.html


2. Passing secrets via command line arguments is well-known bad idea / SNAFU,
because they are visible to other local users that can run "ps" command or read "/proc/<pid>/cmdline".

A better idea will be to put them into conf/catalina.properties

Also see the FAQ
https://wiki.apache.org/tomcat/FAQ/Password

Note that system properties are not logged by default configuration of VersionLoggerListener (configured by the "logProps" attribute).


3. Command line arguments provide important information for troubleshooting.

JVM options, memory size configuration, logging configuration.


4. Logs are well known to contain sensitive information (e.g. they may contain session ids) and shall be protected from world-wide access.


I do not see what can be improved here. Closing as WONTFIX.
Comment 2 jhermann 2017-05-23 11:36:39 UTC
Sorry, should've thought of checking the docs before-hand. Thanks for the hints, those helped.