CVE-2018-8039: Apache CXF TLS Hostname Verification Bypass

Summary

19/10/2018
Yes i
High
8.1

CVE-2018-8039: Apache CXF TLS hostname verification does not work correctly with com.sun.net.ssl.*. Affects org.apache.cxf:cxf-rt-transports-http across 2 version ranges.

< 3.1.16 >= 3.2.0, < 3.2.5

Fixed in 3.1.16 or 3.2.5, depending on the release line you run. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Apache CXF is an open-source web services framework that helps developers build and deploy services using various protocols like SOAP, REST, and more. It provides a comprehensive set of tools and libraries for creating and consuming web services. However, a vulnerability in Apache CXF versions prior to 3.2.5 and 3.1.16 allows for TLS hostname verification bypass, potentially exposing clients to man-in-the-middle attacks.

Vulnerability Detail

The vulnerability arises when Apache CXF is configured to use the com.sun.net.ssl implementation via the 'java.protocol.handler.pkgs' system property. In this configuration, CXF attempts to make the HostnameVerifier work with the old com.sun.net.ssl.HostnameVerifier interface using reflection. However, the default HostnameVerifier implementation in CXF does not implement the required method in this interface, leading to an exception. Unfortunately, prior to the fixed versions, this exception is caught in the reflection code and not properly propagated. As a result, when using the com.sun.net.ssl stack with CXF, TLS hostname verification errors are not thrown, leaving the CXF client vulnerable to man-in-the-middle attacks.

How To Fix

Latest published version: 4.2.4 as of 22 Oct 2026

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 3.1.16 3.1.16
  • >= 3.2.0, < 3.2.5 3.2.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 the fixed versions is not immediately feasible, a possible workaround is to avoid using the com.sun.net.ssl implementation with Apache CXF. Instead, consider using a different SSL implementation that is compatible with CXF and does not exhibit this vulnerability. This can be achieved by not setting the 'java.protocol.handler.pkgs' system property to 'com.sun.net.ssl.internal.www.protocol' or by removing the property altogether.

Conclusion

The vulnerability in Apache CXF versions prior to 3.2.5 and 3.1.16 allows for TLS hostname verification bypass, potentially exposing clients to man-in-the-middle attacks. To mitigate this vulnerability, it is recommended to upgrade to the fixed versions or use a different SSL implementation. Vulert's playground can be used to check if your application is affected by this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.apache.cxf:cxf-rt-transports-http →

Share this vulnerability

FAQ

Apache CXF is an open-source web services framework that allows developers to build and deploy services using various protocols like SOAP, REST, and more.

TLS hostname verification is a security mechanism that ensures the hostname of the server being connected to matches the expected hostname. It helps prevent man-in-the-middle attacks by verifying the identity of the server.

This vulnerability affects Apache CXF users who are using the com.sun.net.ssl implementation and have configured the 'java.protocol.handler.pkgs' system property. It allows for TLS hostname verification bypass, potentially exposing clients to man-in-the-middle attacks.

You can use Vulert's playground at Vulert 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, without requiring access to the code or installation.

The CVSS score of this vulnerability is 8.1, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for org.apache.cxf:cxf-rt-transports-http.

How To Fix

Latest published version: 4.2.4 as of 22 Oct 2026

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 3.1.16 3.1.16
  • >= 3.2.0, < 3.2.5 3.2.5

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback