CVE-2018-12536 in Jetty Serverinfo

Summary

by MITRE

In Eclipse Jetty Server, all 9.x versions, on webapps deployed using default Error Handling, when an intentionally bad query arrives that doesn't match a dynamic url-pattern, and is eventually handled by the DefaultServlet's static file serving, the bad characters can trigger a java.nio.file.InvalidPathException which includes the full path to the base resource directory that the DefaultServlet and/or webapp is using. If this InvalidPathException is then handled by the default Error Handler, the InvalidPathException message is included in the error response, revealing the full server path to the requesting system.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 03/29/2023

The vulnerability identified as CVE-2018-12536 affects Eclipse Jetty Server versions 9.x and represents a critical information disclosure flaw that stems from improper error handling mechanisms within the web application server. This vulnerability specifically manifests when web applications utilize the default error handling configuration and encounter malformed URL requests that do not match any defined dynamic URL patterns. The issue occurs during the processing of such requests when they eventually fall through to the DefaultServlet's static file serving functionality, creating a scenario where malicious actors can exploit the server's response handling to extract sensitive directory path information.

The technical root cause of this vulnerability lies in the Java NIO library's path validation mechanisms and how Jetty's default error handler processes exceptions. When a malformed query string is processed by the DefaultServlet and subsequently triggers a java.nio.file.InvalidPathException, the exception message contains the complete file system path to the web application's base resource directory. This occurs because the DefaultServlet does not properly sanitize or filter the input before passing it to the path validation routines, allowing the full server path to be exposed in the exception message. The vulnerability is particularly dangerous because it leverages the standard error handling mechanisms that are typically enabled by default in Jetty deployments, making it accessible to attackers without requiring specialized exploitation techniques.

The operational impact of this vulnerability extends beyond simple information disclosure, as it provides attackers with critical system architecture information that can be used for further exploitation attempts. The leaked directory paths can reveal the exact location of web applications on the server, potentially exposing sensitive organizational structures and deployment configurations. This information can facilitate subsequent attacks such as directory traversal attempts, local file inclusion vulnerabilities, or other path-based exploitation techniques. The vulnerability affects all versions of Jetty 9.x, making it particularly widespread across organizations that have not yet upgraded their server implementations, and represents a significant risk to web application security posture.

Organizations affected by this vulnerability should immediately implement mitigations through proper error handling configuration and input validation. The recommended approach involves customizing the error handling mechanism to prevent sensitive path information from being exposed in error responses, which aligns with security best practices outlined in CWE-209 and CWE-470. Implementing custom error handlers that sanitize exception messages and do not expose internal system paths provides the most effective defense against this particular vulnerability. Additionally, organizations should consider upgrading to newer versions of Jetty where this issue has been resolved, as well as implementing comprehensive monitoring and logging of error conditions to detect potential exploitation attempts. The ATT&CK framework categorizes this vulnerability under T1083 (File and Directory Discovery) and T1213 (Data from Information Repositories) as it enables attackers to discover system information and potentially extract data through path disclosure mechanisms that can be leveraged for further reconnaissance activities.

Reservation

06/18/2018

Disclosure

06/27/2018

Moderation

accepted

CPE

ready

EPSS

0.04328

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!