CVE-2018-1304: Vulnerability in org.apache.tomcat.embed:tomcat-embed-core
Summary
CVE-2018-1304: Apache Tomcat unauthorized access vulnerability. Affects org.apache.tomcat.embed:tomcat-embed-core across 4 version ranges.
>= 7.0.0, < 7.0.86
>= 8.0.0, < 8.0.51
>= 8.5.0, < 8.5.28
>= 9.0.0, < 9.0.5
Fixed in 4 releases; the minimum fixed version depends on the release line you run. 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
The org.apache.tomcat.embed:tomcat-embed-core package is a part of Apache Tomcat, an open-source web server and servlet container. It provides the core functionality for embedding Tomcat into other applications. This package is widely used in Java-based web applications to handle HTTP requests and serve web content.
Vulnerability Detail
The vulnerability identified as CVE-2018-1304 affects the org.apache.tomcat.embed:tomcat-embed-core package. It arises from an issue in handling the URL pattern of the empty string, which maps to the context root. This flaw was present in Apache Tomcat versions 9.0.0.M1 to 9.0.4, 8.5.0 to 8.5.27, 8.0.0.RC1 to 8.0.49, and 7.0.0 to 7.0.84 when used in security constraint definitions. As a result, security constraints with an empty string URL pattern were ignored, allowing unauthorized users to access protected web application resources. This vulnerability has a CVSS score of 5.9, indicating a moderate severity level.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 7.0.0, < 7.0.867.0.86 -
>= 8.0.0, < 8.0.518.0.51 -
>= 8.5.0, < 8.5.288.5.28 -
>= 9.0.0, < 9.0.59.0.5
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
If upgrading to a fixed version is not immediately feasible, a temporary workaround can be implemented by modifying the security constraint definitions to use a non-empty URL pattern instead of the empty string. This will ensure that the constraints are properly applied and unauthorized access to protected resources is prevented. Here is an example of how the security constraint definition can be modified:
Before:
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Resources</web-resource-name>
<url-pattern></url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
After:
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Resources</web-resource-name>
<url-pattern>/protected/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
Conclusion
In conclusion, the org.apache.tomcat.embed:tomcat-embed-core package is vulnerable to CVE-2018-1304, which allows unauthorized access to protected web application resources. It is crucial to upgrade to the fixed versions or apply the provided workaround to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for org.apache.tomcat.embed:tomcat-embed-core →
FAQ
This vulnerability allows unauthorized users to bypass security constraints and gain access to web application resources that should be protected. It can lead to unauthorized disclosure of sensitive information or unauthorized modification of data.
The vulnerability affects Apache Tomcat versions 9.0.0.M1 to 9.0.4, 8.5.0 to 8.5.27, 8.0.0.RC1 to 8.0.49, and 7.0.0 to 7.0.84.
Yes, upgrading to the fixed versions of the org.apache.tomcat.embed:tomcat-embed-core package will address this vulnerability. The fixed versions are 9.0.5, 8.5.28, 8.0.51, and 7.0.86.
Yes, a temporary workaround is to modify the security constraint definitions to use a non-empty URL pattern instead of the empty string. This will ensure that the constraints are properly enforced.
You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities in software using just the pom.xml file.
References
Related vulnerabilities
Recent vulnerabilities recorded for org.apache.tomcat.embed:tomcat-embed-core.