CVE-2016-8739: Apache CXF JAX-RS XML External Entity Reference Vulnerability
Summary
CVE-2016-8739: Improper Restriction of XML External Entity Reference in Apache CXF JAX-RS. Affects org.apache.cxf:cxf-core across 2 version ranges.
< 3.0.12
>= 3.1.0, < 3.1.9
Fixed in 3.0.12 or 3.1.9, depending 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
Apache CXF is an open-source services framework that helps build and develop web services using standard protocols such as SOAP and REST. The JAX-RS module in Apache CXF provides support for building RESTful web services. The vulnerability identified as CVE-2016-8739 affects the JAX-RS module in Apache CXF versions prior to 3.0.12 and 3.1.x prior to 3.1.9. This vulnerability arises due to improper restriction of XML external entity references in the Apache CXF JAX-RS module. The module uses Apache Abdera Parser, which by default expands XML entities, leading to a significant XML External Entity (XXE) risk.
Vulnerability Detail
The vulnerability allows an attacker to exploit XML external entity references, which can result in various security risks. By leveraging this vulnerability, an attacker can read arbitrary files on the server, perform server-side request forgery (SSRF) attacks, or conduct denial-of-service (DoS) attacks. The improper handling of XML entities can lead to the disclosure of sensitive information, unauthorized access to internal resources, or the execution of arbitrary code. This vulnerability has a CVSS score of 7.5, indicating a high severity level.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 3.0.123.0.12 -
>= 3.1.0, < 3.1.93.1.9
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 disabling the expansion of XML entities in the Apache CXF JAX-RS module. This can be achieved by modifying the configuration of the module to disable entity expansion. Here is an example of how to disable entity expansion in the Apache CXF JAX-RS module configuration:
<jaxrs:providers>
<bean class="org.apache.cxf.jaxrs.provider.atom.AtomPojoProvider">
<property name="expandEntityReferences" value="false"/>
</bean>
```
</jaxrs:providers>
```
Please note that this workaround may have implications on the functionality of the affected module, and upgrading to a fixed version is strongly recommended.
Conclusion
The Apache CXF JAX-RS XML External Entity Reference vulnerability (CVE-2016-8739) poses a significant risk to applications using affected versions of Apache CXF. It is crucial to upgrade to the fixed versions (3.0.12 or later for the 3.0.x branch, and 3.1.9 or later for the 3.1.x branch) to mitigate this vulnerability. If immediate upgrading is not possible, applying the provided workaround to disable entity expansion can help mitigate the risk temporarily. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for org.apache.cxf:cxf-core →
FAQ
Apache CXF is an open-source services framework that helps build and develop web services using standard protocols such as SOAP and REST.
The JAX-RS module in Apache CXF provides support for building RESTful web services.
XML External Entity (XXE) vulnerability is a type of security vulnerability that allows an attacker to exploit XML parsers by injecting malicious XML entities, leading to various security risks.
The potential risks of this vulnerability include unauthorized access to sensitive information, server-side request forgery (SSRF) attacks, denial-of-service (DoS) attacks, and the execution of arbitrary code.
The CVSS score of this vulnerability is 7.5, indicating a high severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for org.apache.cxf:cxf-core.