CVE-2025-49124: Tomcat Vulnerability In 9.0.62
Hey guys! Let's dive into a critical security issue that has been identified in the tomcat-embed-core-9.0.62.jar library. This vulnerability, labeled as CVE-2025-49124, is a medium-severity threat that you need to be aware of, especially if you're using Apache Tomcat in your projects. In this article, we will explore the vulnerability details, its impact, and how to mitigate it effectively. Let's get started!
What is CVE-2025-49124?
CVE-2025-49124 is an Untrusted Search Path vulnerability found in the Apache Tomcat installer for Windows. Specifically, the issue arises because the installer uses icacls.exe without specifying its full path during the installation process. This can potentially allow malicious actors to exploit the system by placing a rogue icacls.exe in the system's search path, leading to unauthorized modifications of file permissions and system compromise.
Vulnerable Library: tomcat-embed-core-9.0.62.jar
The vulnerable component is located within the tomcat-embed-core-9.0.62.jar file, which is a core part of the Tomcat implementation. This library is crucial for running Tomcat in embedded environments, making this vulnerability a significant concern for applications using Spring Boot and other frameworks that rely on embedded Tomcat. The library's home page is https://tomcat.apache.org/, where you can find more information about Apache Tomcat.
Where is it located?
The vulnerable library was found in the following path within the project:
/home/wss-scanner/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/9.0.62/5cfba48171140b53d53f730633cc6310fa63e12/tomcat-embed-core-9.0.62.jar
This path indicates that the library is managed by Gradle, a popular build automation tool. It’s essential to check your project's dependencies and ensure that you're not using vulnerable versions of Tomcat.
Dependency Hierarchy
The vulnerability exists within a dependency hierarchy, which means it's not directly included in the project but rather pulled in as a dependency of another library. Here's the breakdown:
spring-boot-starter-web-2.6.7.jar(Root Library)spring-boot-starter-tomcat-2.6.7.jartomcat-embed-core-9.0.62.jar(Vulnerable Library)
This hierarchy shows that tomcat-embed-core-9.0.62.jar is a transitive dependency, meaning it’s included because spring-boot-starter-tomcat-2.6.7.jar depends on it, and spring-boot-starter-tomcat-2.6.7.jar is included because spring-boot-starter-web-2.6.7.jar depends on it. This is a common scenario in modern application development, where projects rely on numerous libraries and their dependencies.
Commit and Branch Information
The vulnerability was found in the HEAD commit: 221846a53b58bd81f8871124435f978a2f6903d3 and the base branch main. This information is crucial for developers to identify exactly where the vulnerable code exists within their codebase and to apply the necessary fixes.
Vulnerability Details
This untrusted search path vulnerability can be exploited if an attacker manages to place a malicious executable named icacls.exe in a directory that is included in the system's search path and precedes the actual location of the legitimate icacls.exe. When the Tomcat installer runs, it may inadvertently execute the malicious icacls.exe instead of the intended one, leading to unauthorized changes in file permissions.
Affected Versions
The following Apache Tomcat versions are affected by this vulnerability:
- 11.0.0-M1 through 11.0.7
- 10.1.0 through 10.1.41
- 9.0.23 through 9.0.105
- (EOL) 8.5.0 through 8.5.100
- (EOL) 7.0.95 through 7.0.109
It's important to note that versions 8.5.0 through 8.5.100 and 7.0.95 through 7.0.109 were End-of-Life (EOL) at the time the CVE was created but are known to be affected. Using EOL versions is highly discouraged due to the lack of security updates and ongoing support.
Recommended Action
It is strongly recommended that users upgrade to the following versions, which address the vulnerability:
- 11.0.8
- 10.1.42
- 9.0.106
Upgrading to these versions will ensure that the vulnerability is patched, and your system is protected against potential exploits.
CVSS 3 Score Details
The Common Vulnerability Scoring System (CVSS) provides a standardized way to assess the severity of security vulnerabilities. CVE-2025-49124 has a CVSS 3 base score of 6.3, which is considered a Medium severity.
Base Score Metrics
The CVSS 3 score is derived from several metrics that evaluate different aspects of the vulnerability. Here’s a breakdown of the key metrics:
Exploitability Metrics:
- Attack Vector: Network: This means the vulnerability can be exploited over a network, making it more accessible to attackers.
- Attack Complexity: Low: The vulnerability is relatively easy to exploit, requiring minimal effort from the attacker.
- Privileges Required: None: No special privileges are needed to exploit this vulnerability, making it easier for attackers to target systems.
- User Interaction: Required: Exploitation requires some form of user interaction, such as running the Tomcat installer.
- Scope: Unchanged: The vulnerability affects only the Tomcat installation and does not extend to other parts of the system.
Impact Metrics:
- Confidentiality Impact: Low: Exploitation could lead to a limited disclosure of information.
- Integrity Impact: Low: The integrity of the system could be slightly compromised, but not completely.
- Availability Impact: Low: The availability of the system might be slightly affected, but not severely.
For more detailed information on CVSS3 Scores, you can refer to the CVSS Calculator.
Suggested Fix
The most effective way to address CVE-2025-49124 is to upgrade to a patched version of Apache Tomcat. Here are the details:
- Type: Upgrade version
- Release Date: 2025-06-16
- Fix Resolution: https://github.com/apache/tomcat.git - 9.0.106
By upgrading to version 9.0.106 or later, you will incorporate the necessary fix that mitigates the untrusted search path vulnerability. This ensures that the Tomcat installer uses the correct icacls.exe and prevents unauthorized modifications.
How to Upgrade Tomcat
Upgrading Tomcat typically involves the following steps:
- Backup your current Tomcat installation: Before making any changes, back up your existing Tomcat installation. This ensures that you can revert to the previous state if something goes wrong.
- Download the latest version: Download the patched version of Tomcat (9.0.106 or later) from the Apache Tomcat website.
- Stop the Tomcat server: Stop the current Tomcat server to prevent any conflicts during the upgrade process.
- Replace the Tomcat files: Replace the files in your existing Tomcat installation directory with the files from the new version. Be sure to preserve any custom configurations or settings.
- Update environment variables: If you have any environment variables pointing to the Tomcat installation, update them to reflect the new version.
- Start the Tomcat server: Start the Tomcat server with the upgraded version.
- Test the application: Thoroughly test your application to ensure that the upgrade was successful and that all functionalities are working as expected.
Additional Security Measures
In addition to upgrading Tomcat, consider implementing the following security best practices:
- Keep dependencies up-to-date: Regularly update all libraries and frameworks used in your project to the latest versions to benefit from security patches and bug fixes.
- Use a dependency checker: Utilize tools like Mend to automatically scan your project dependencies for known vulnerabilities and provide remediation advice.
- Implement the principle of least privilege: Ensure that applications and users have only the necessary permissions to perform their tasks, reducing the potential impact of a security breach.
- Regular security audits: Conduct periodic security audits to identify and address potential vulnerabilities in your system.
Conclusion
So, there you have it, guys! CVE-2025-49124 is a medium-severity vulnerability affecting Apache Tomcat, and it's crucial to take the necessary steps to mitigate it. By understanding the vulnerability, its impact, and the recommended fix, you can ensure the security and integrity of your applications. Remember to upgrade to the latest patched version of Tomcat and follow other security best practices to protect your systems.
Stay secure and keep those applications running smoothly! And as Mend suggests, let's step up our Open Source Security Game with tools and best practices to keep our projects safe and sound.