Apache Camel XML External Entity Injection via camel-xpath
An XML External Entity (XXE) vulnerability in the Apache Camel camel-xpath component allows attackers to trigger local file disclosure or server-side request forgery when documentType is set to InputSource.
CVE search metadata
CVE search record: CVE-2026-85250. Severity: high. CVSS: 7.5. KEV: no. Product: camel-xpath (< 4.18.5, 4.19.0 to 4.22.1), camel-spring-boot (3.5.13), camel-quarkus (3.29.0). Brief: Apache Camel XML External Entity Injection via camel-xpath. Brief link: https://feed.craftedsignal.io/briefs/2026-10-camel-xpath-xxe/
Apache Camel is vulnerable to XML External Entity (XXE) injection (CVE-2026-85250) within the camel-xpath component. The vulnerability exists when an XPath expression is configured with documentType=InputSource. Under this configuration, the XPathBuilder passes the XML input directly to javax.xml.xpath, which utilizes default JDK XML parser settings. This process bypasses the security hardening applied to Apache Camel’s default document type, allowing the parser to resolve DOCTYPE declarations and expand external entities.
If an application processes untrusted XML using this configuration, an attacker can supply a malicious DOCTYPE to exfiltrate sensitive local files accessible by the service account or perform Server-Side Request Forgery (SSRF) against internal resources. Apache has released patches in versions 4.18.5, 4.22.1, and 4.23.0 to force InputSource inputs through the same hardened DocumentBuilderFactory used by the default document type.
Attack Chain
- An attacker identifies an application endpoint or service that processes user-supplied XML using Apache Camel's
camel-xpathcomponent. - The application is configured to use
.documentType(InputSource.class)for XPath evaluation on the incoming XML stream. - The attacker crafts a malicious XML payload containing a
DOCTYPEdeclaration with an external entity pointing to a local file or internal network resource (e.g.,&xxe;referencing/etc/passwdor an internal API endpoint). - The XML payload is sent to the vulnerable service via an HTTP POST request or another XML-consuming interface.
- The
XPathBuilderprocesses the payload using the unhardened JDK default parser configuration. - The XML parser resolves the external entity and retrieves the contents of the local file or makes an outbound HTTP request from the server.
- The application returns the results of the XPath evaluation, containing the exfiltrated file contents or the response from the targeted internal resource.
Impact
Successful exploitation leads to unauthorized local file disclosure and potential server-side request forgery. This allows attackers to access sensitive system files, application configuration files, or internal network services that are otherwise protected by the network perimeter. The severity is rated as high due to the potential for full file system access within the context of the application process.
Recommendation
- Patch Apache Camel to version 4.18.5, 4.22.1, or 4.23.0 immediately as documented in the vendor security advisory.
- For applications using Apache Camel Spring Boot or Quarkus, update to the versions that incorporate the fixed Camel library versions (e.g., camel-quarkus-xpath fixes released in CQ 3.40.0).
- Audit codebase for explicit use of
.documentType(InputSource.class)inXPathBuilderand replace with the default document type, which is already hardened against XXE. - Implement strict input validation and sanitization for all incoming XML data to prevent malicious
DOCTYPEdeclarations.
Immediate actions
Upgrade Apache Camel to 4.18.5, 4.22.1, or 4.23.0 across all environments.
Threat Hunt
Identify endpoints processing XML payloads that utilize Apache Camel XPath evaluation.
Data: Application dependency inventory
Mitigations
Disable use of InputSource documentType in XPathBuilder until patching is complete.
CVE-2026-85250