This FAQ section provides help with some security-related issues. If you hear of a vulnerability or its exploitation, please let us know on the <security AT tomcat DOT apache DOT org> mailing list.
There have been no public cases of damage done to a company, organization, or individual due to a Tomcat security issue. There have been no documented cases of data loss or application crashes caused by an intruder. While there have been numerous analyses conducted on Tomcat, partially because this is easy to do with Tomcat's source code openly available, there have been only theoretical vulnerabilities found. All of those were addressed even though there were no documented cases of actual exploitation of these vulnerabilities.
Role of Customization
We believe, and the evidence suggests, that Tomcat is more than secure enough for most use-cases. However, like all other components of Tomcat, you can customize any and all of the relevant parts of the server to achieve even higher security. For example, the session manager implementation is pluggable, and even the default implementation has support for pluggable random number generators. If you have a special need that you feel is not met by Tomcat out of the box, consider these customization options. At the same time, please bring up your requirements on the user mailing list, where we'll be glad to discuss it and assist in your approach/design/implementation as needed.
Known vulnerabilities http://tomcat.apache.org/security.html
How do I use OpenSSL to set up my own Certificate Authority (CA)?
Oh no! Port 8005 is available for anyone on localhost to shutdown my tomcat!
See these 2 discussions.
What about Tomcat running as root?
See these threads:
How do I force all my pages to run under HTTPS?
What is the default login for the manager and admin app?
The admin and manager application do not provide a default login. Doing so would be a security flaw. You need to edit $CATALINA_HOME/conf/tomcat-users.xml file if you are using the default install. See Configuring Manager Application Access for details.
Note that there exists malware that tries to guess the manager password.
There was once a bug that blindly clicking-trough the Windows installer configured a manager user with blank password (CVE-2009-3548). This was fixed by April 2010 (Tomcat 5.5.29, 6.0.24 and later are safe).
How do I restrict access by ip address or remote host?
By using the RemoteHostValve or RemoteAddrValve. Warning, these valves rely on accurate incoming ip addresses or hostnames. So they can fall victim to spoofing! See also RemoteIpValve. Valve Reference Link
How do I use jsvc/procrun to run Tomcat on port 80 securely?
Fairly easily See the Setup page in the docs for your tomcat release, and read this mailing list post for a complete setup example with permissions etc.
Has Tomcat's security been independently analyzed or audited?
Yes, by numerous organizations and individuals, many times. Try this Google search and you'll see many references, guides, and analyses.
How do I change the Server header in the response?
In server.xml - add a "server" attribute to the Connector element. http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
Why are passwords in plain text?
We have a page dedicated to this topic. FAQ/Password
How can I restrict the list of ciphers used for HTTPS?
Is Tomcat vulnerable to Heartbleed bug?
Is Tomcat vulnerable to POODLE attack?
Which cipher suites should I use?