CVE-2018-8039: Cxf rt transports http Apache CXF TLS Hostname Verification Vulnerability

HIGH
Advisory Identifier: GHSA-jc7r-v6fg-2gpf
CVSS 8.1
CWE-755
Published
Advisory Summary

CVE-2018-8039 is a HIGH (CVSS 8.1) apache cxf tls hostname verification vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting Cxf rt transports http libraries in the Maven ecosystem. The issue involves apache cxf tls hostname verification does not work correctly with com.sun.net.ssl.*. Remediation is available by upgrading affected packages to version 3.2.5, 3.1.16.

CVE-2018-8039 at a Glance

CVE Identifier CVE-2018-8039
GHSA Identifier GHSA-jc7r-v6fg-2gpf
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-755: Improper Handling of Exceptional Conditions
Affected Product Cxf rt transports http
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2018-8039

To remediate this vulnerability, upgrade all affected Cxf rt transports http dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.cxf:cxf-rt-transports-http fixed: 3.2.5
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http</artifactId>
    <version>3.2.5</version>
</dependency>
org.apache.cxf:cxf-rt-transports-http fixed: 3.1.16
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http</artifactId>
    <version>3.1.16</version>
</dependency>
org.apache.cxf:apache-cxf fixed: 3.2.5
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>apache-cxf</artifactId>
    <version>3.2.5</version>
</dependency>
org.apache.cxf:apache-cxf fixed: 3.1.16
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>apache-cxf</artifactId>
    <version>3.1.16</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.cxf

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2018-8039, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.cxf

Analyze the terminal output to locate any version of Cxf rt transports http in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.5), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.cxf command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. In Cxf rt transports http, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2018-8039 Affected Cxf rt transports http Versions

4 component(s)
Fixed Versions:
3.2.53.1.16
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.cxf:cxf-rt-transports-http
Maven
≥ 3.2.0
< 3.2.5
3.2.5
org.apache.cxf:cxf-rt-transports-http
Maven
< 3.1.16
3.1.16
org.apache.cxf:apache-cxf
Maven
≥ 3.2.0
< 3.2.5
3.2.5
org.apache.cxf:apache-cxf
Maven
< 3.1.16
3.1.16

References

NVD — CVE-2018-8039 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-8039
Security Fix Commit FIX COMMIT
https://github.com/apache/cxf/commit/fae6fabf9bd7647f5e9cb68897a7d72b545b741b
Security Fix Commit FIX COMMIT
https://github.com/apache/cxf/commit/8ed6208f987ff72e4c4d2cf8a6b1ec9b27575d4
Cxf rt transports http Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html
Cxf rt transports http Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2020.html
Cxf rt transports http Security Information SECURITY
https://www.oracle.com/security-alerts/cpuapr2020.html
lists.apache.org/thread.html/rff42cf... WEB
https://lists.apache.org/thread.html/rff42cfa5e7d75b7c1af0e37589140a8f1999e578a75738740b244bd4@%3Ccommits.cxf.apache.org%3E
lists.apache.org/thread.html/rfb87e0... WEB
https://lists.apache.org/thread.html/rfb87e0bf3995e7d560afeed750fac9329ff5f1ad49da365129b7f89e@%3Ccommits.cxf.apache.org%3E
lists.apache.org/thread.html/rec7160... WEB
https://lists.apache.org/thread.html/rec7160382badd3ef4ad017a22f64a266c7188b9ba71394f0d321e2d4@%3Ccommits.cxf.apache.org%3E
lists.apache.org/thread.html/rd49aab... WEB
https://lists.apache.org/thread.html/rd49aabd984ed540c8ff7916d4d79405f3fa311d2fdbcf9ed307839a6@%3Ccommits.cxf.apache.org%3E
lists.apache.org/thread.html/rc77427... WEB
https://lists.apache.org/thread.html/rc774278135816e7afc943dc9fc78eb0764f2c84a2b96470a0187315c@%3Ccommits.cxf.apache.org%3E
lists.apache.org/thread.html/r36e44f... WEB
https://lists.apache.org/thread.html/r36e44ffc1a9b365327df62cdfaabe85b9a5637de102cea07d79b2dbf@%3Ccommits.cxf.apache.org%3E
lists.apache.org/thread.html/1f8ff31... WEB
https://lists.apache.org/thread.html/1f8ff31df204ad0374ab26ad333169e0387a5e7ec92422f337431866@%3Cdev.cxf.apache.org%3E
Cxf rt transports http Source Repository REPOSITORY
https://github.com/apache/cxf
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-jc7r-v6fg-2gpf
Cxf rt transports http Security Information SECURITY
https://cxf.apache.org/security-advisories.data/CVE-2018-8039.txt.asc
access.redhat.com/errata/rhsa-2018:38... WEB
https://access.redhat.com/errata/RHSA-2018:3817
access.redhat.com/errata/rhsa-2018:37... WEB
https://access.redhat.com/errata/RHSA-2018:3768
access.redhat.com/errata/rhsa-2018:26... WEB
https://access.redhat.com/errata/RHSA-2018:2643
access.redhat.com/errata/rhsa-2018:24... WEB
https://access.redhat.com/errata/RHSA-2018:2428
access.redhat.com/errata/rhsa-2018:24... WEB
https://access.redhat.com/errata/RHSA-2018:2425
access.redhat.com/errata/rhsa-2018:24... WEB
https://access.redhat.com/errata/RHSA-2018:2424
access.redhat.com/errata/rhsa-2018:24... WEB
https://access.redhat.com/errata/RHSA-2018:2423
access.redhat.com/errata/rhsa-2018:22... WEB
https://access.redhat.com/errata/RHSA-2018:2279
access.redhat.com/errata/rhsa-2018:22... WEB
https://access.redhat.com/errata/RHSA-2018:2277
access.redhat.com/errata/rhsa-2018:22... WEB
https://access.redhat.com/errata/RHSA-2018:2276
Cxf rt transports http Security Information SECURITY
http://www.securityfocus.com/bid/106357
Cxf rt transports http Security Information SECURITY
http://www.securitytracker.com/id/1041199

Frequently Asked Questions

What is CVE-2018-8039?
CVE-2018-8039 is a security vulnerability in Cxf rt transports http involving Apache CXF TLS hostname verification does not work correctly with com.sun.net.ssl.* under CWE-755: Improper Handling of Exceptional Conditions.
Which Cxf rt transports http versions are affected?
Affected versions include releases prior to 3.2.5, 3.1.16 across affected packages: org.apache.cxf:cxf-rt-transports-http, org.apache.cxf:apache-cxf.
What version fixes CVE-2018-8039?
Upgrading to 3.2.5, 3.1.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cxf-rt-transports-http affected?
Yes, org.apache.cxf:cxf-rt-transports-http is affected in releases prior to 3.2.5, 3.1.16. Upgrade your dependency to 3.2.5, 3.1.16 or later.
Is apache-cxf affected?
Yes, org.apache.cxf:apache-cxf is affected in releases prior to 3.2.5, 3.1.16. Upgrade your dependency to 3.2.5, 3.1.16 or later.
What is the CVSS score of CVE-2018-8039?
CVE-2018-8039 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-8039?
CVE-2018-8039 is classified under CWE-755: Improper Handling of Exceptional Conditions (The product does not handle or incorrectly handles an exceptional condition.).
How can I check Maven dependencies for CVE-2018-8039?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.cxf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jc7r-v6fg-2gpf",
  "modified" : "2025-05-29T17:42:39Z",
  "published" : "2018-10-19T16:40:01Z",
  "aliases" : [ "CVE-2018-8039" ],
  "summary" : "Apache CXF TLS hostname verification does not work correctly with com.sun.net.ssl.*",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cxf:cxf-rt-transports-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.0"
      }, {
        "fixed" : "3.2.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cxf:cxf-rt-transports-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.16"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cxf:apache-cxf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.0"
      }, {
        "fixed" : "3.2.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.cxf:apache-cxf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.16"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-8039"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/cxf/commit/fae6fabf9bd7647f5e9cb68897a7d72b545b741b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/cxf/commit/8ed6208f987ff72e4c4d2cf8a6b1ec9b27575d4"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2020.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2020.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rff42cfa5e7d75b7c1af0e37589140a8f1999e578a75738740b244bd4@%3Ccommits.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rfb87e0bf3995e7d560afeed750fac9329ff5f1ad49da365129b7f89e@%3Ccommits.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rec7160382badd3ef4ad017a22f64a266c7188b9ba71394f0d321e2d4@%3Ccommits.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rd49aabd984ed540c8ff7916d4d79405f3fa311d2fdbcf9ed307839a6@%3Ccommits.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc774278135816e7afc943dc9fc78eb0764f2c84a2b96470a0187315c@%3Ccommits.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r36e44ffc1a9b365327df62cdfaabe85b9a5637de102cea07d79b2dbf@%3Ccommits.cxf.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/1f8ff31df204ad0374ab26ad333169e0387a5e7ec92422f337431866@%3Cdev.cxf.apache.org%3E"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/cxf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-jc7r-v6fg-2gpf"
  }, {
    "type" : "WEB",
    "url" : "https://cxf.apache.org/security-advisories.data/CVE-2018-8039.txt.asc"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3817"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:3768"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2643"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2428"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2425"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2424"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2423"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2279"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2277"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2276"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/106357"
  }, {
    "type" : "WEB",
    "url" : "http://www.securitytracker.com/id/1041199"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-755" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:43:00Z",
    "nvd_published_at" : "2018-07-02T13:29:00Z"
  }
}