CVE-2018-8039: High severity Apache CXF vulnerability
A flaw was found in the way Apache CXF handle exceptions when CXF is configured to use the com.sun.net.ssl implementation via System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol") function. When this system property is set, CXF uses some reflection to try to make the HostnameVerifier work with the old com.sun.net.ssl.HostnameVerifier interface. However, the default HostnameVerifier implementation in CXF does not implement the method in this interface therefore an exception is thrown. The exception is caught in the reflection code but not properly propagated which leaves CXF client subject to man-in-the-middle attacks.
Upstream Patch: https://github.com/apache/cxf/commit/fae6fabf9bd7647f5e9cb68897a7d7
Other sources
Apache CXF could allow a remote attacker to conduct a man-in-the-middle attack. The TLS hostname verification does not work correctly with com.sun.net.ssl interface. An attacker could exploit this vulnerability to launch a man-in-the-middle attack.
— IBM
It is possible to configure Apache CXF to use the com.sun.net.ssl implementation via 'System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");'. When this system property is set, CXF uses some reflection to try to make the HostnameVerifier work with the old com.sun.net.ssl.HostnameVerifier interface. However, the default HostnameVerifier implementation in CXF does not implement the method in this interface, and an exception is thrown. However, in Apache CXF prior to 3.2.5 and 3.1.16 the exception is caught in the reflection code and not properly propagated. What this means is that if you are using the com.sun.net.ssl stack with CXF, an error with TLS hostname verification will not be thrown, leaving a CXF client subject to man-in-the-middle attacks.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is CVE-2018-8039?
CVE-2018-8039 is a vulnerability in Apache CXF that could allow a remote attacker to conduct a man-in-the-middle attack.
How does the vulnerability in Apache CXF work?
The vulnerability is caused by configuring Apache CXF to use the com.sun.net.ssl implementation, which allows the HostnameVerifier to work with old com.sun classes.
What is the severity of CVE-2018-8039?
The severity of CVE-2018-8039 is high, with a CVSS score of 8.1.
Which software versions are affected by CVE-2018-8039?
Apache CXF versions up to 3.2.5 and versions up to 3.1.16 are affected by CVE-2018-8039.
How can I fix CVE-2018-8039?
To fix CVE-2018-8039, upgrade to Apache CXF version 3.2.6 or later, or version 3.1.17 or later.