CVE-2007-3383: Apache Tomcat SendMailServlet XSS
Summary
CVE-2007-3383: Apache Tomcat SendMailServlet XSS. Affects org.apache.tomcat:tomcat across 2 version ranges.
>= 4.0.0, <= 4.0.6
>= 4.1.0, <= 4.1.36
No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Apache Tomcat is an open-source web server and servlet container that is used to execute Java servlets and render web pages that include Java Server Page (JSP) code. It provides a Java-based HTTP web server environment for running Java code. The SendMailServlet is a part of the examples web application in Apache Tomcat, which allows users to send emails through a web interface. However, a cross-site scripting (XSS) vulnerability exists in the SendMailServlet, specifically in the sendmail.jsp file. This vulnerability affects Apache Tomcat versions 4.0.0 through 4.0.6 and 4.1.0 through 4.1.36.
Vulnerability Detail
The XSS vulnerability in SendMailServlet allows remote attackers to inject arbitrary web script or HTML into the application. This can occur when the attacker manipulates the 'From' field or other related fields, leading to the generation of error messages that include the injected code. If successfully exploited, this vulnerability can enable various attacks, such as session hijacking, defacement of web pages, or stealing sensitive information from users.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, users can modify the affected sendmail.jsp file to sanitize user input and prevent the execution of injected code. Here is an example of how to sanitize the 'From' field using Java code:
String from = request.getParameter("from");
from = from.replaceAll("<", "<").replaceAll(">", ">");
This code replaces the '<' and '>' characters with their HTML entity equivalents, preventing the execution of any injected HTML or script tags.
Conclusion
The XSS vulnerability in Apache Tomcat's SendMailServlet can allow remote attackers to inject arbitrary web script or HTML into the application, potentially leading to various security risks. It is crucial to upgrade to a non-vulnerable version of Apache Tomcat and implement proper input sanitization to mitigate this vulnerability. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for org.apache.tomcat:tomcat →
FAQ
Apache Tomcat is an open-source web server and servlet container that is used to execute Java servlets and render web pages that include Java Server Page (JSP) code.
The SendMailServlet is a part of the examples web application in Apache Tomcat, which allows users to send emails through a web interface.
Cross-site scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users.
If successfully exploited, this vulnerability can enable various attacks, such as session hijacking, defacement of web pages, or stealing sensitive information from users.
To protect your application, it is recommended to upgrade to a version of Apache Tomcat that is not affected by this issue and to review and sanitize user input to prevent the injection of malicious code.
Related vulnerabilities
Recent vulnerabilities recorded for org.apache.tomcat:tomcat.