CVE-2026-88901
Camel-Smooks: XML external entity processing - the Smooks data format and component parsed the incoming XML message body with the reader Smooks resolves by default, which resolves external general and parameter entities and loads external DTDs, so an external entity declared in that body could read local files or reach internal hosts
Description
Improper Restriction of XML External Entity Reference in the Smooks component (camel-smooks) in Apache Camel allows an attacker who supplies the XML message body to read local files or issue requests to internal network locations via an external entity declaration in that body. This issue affects Apache Camel: from 4.7.0 before 4.18.5, from 4.19.0 before 4.22.1. The Smooks data format (.unmarshal().smooks(...)) and the Smooks component (smooks:) parse the incoming XML body with the reader Smooks resolves by default, which is the Woodstox SAX parser. That reader resolves external general and parameter entities and loads external DTDs, and camel-smooks applied none of the parser hardening that the other Camel XML components apply. A DOCTYPE with an external subset, or an external general entity, declared in the XML document is therefore resolved and expanded while the body is unmarshalled, and the resolved content is bound into the unmarshalled result and returned on InOut routes. An external sender whose XML reaches a camel-smooks data format or endpoint could therefore read files readable by the Camel process and cause the process to issue requests to hosts the document names. No non-default option is required, since resolving external entities was the default behaviour. Configurations that declare their own reader - EDI, CSV, JSON, or a custom reader - do not use the XML reader and are not affected. Users are recommended to upgrade to version 4.18.5, 4.22.1 or 4.23.0, which fixes the issue.
Mitigation
Credit
This issue was reported by h1ei1
Notes
The JIRA ticket: https://issues.apache.org/jira/browse/CAMEL-24677 refers to the commits that resolved the issue, and has more details.
The fix was merged on main in https://github.com/apache/camel/pull/26270 (commit 4b1fc499a0ceff909612b5310152cd71517888f7), and backported to camel-4.22.x in https://github.com/apache/camel/pull/26327 (commit 1b375c171e2546cafdcaadc2aa9f7346a25a4cd7) and to camel-4.18.x in https://github.com/apache/camel/pull/26329 (commit 680290f6ba5324301673b7353564130af6d2ad83).
camel-smooks now parses untrusted XML with a javax.xml.parsers.DocumentBuilder configured with FEATURE_SECURE_PROCESSING and with external general entities, external parameter entities and external DTD loading disabled, and hands Smooks the resulting DOM, rather than letting Smooks parse the body with its default Woodstox reader. Because the reader Smooks uses is shared across every source type, reconfiguring it would also break the non-XML readers used for marshalling and for EDI, CSV and JSON; the DOM pre-parse is therefore applied only when the configuration parses XML with its default reader, detected by the absence of a declared reader, and the marshalling direction is left unchanged. The allowExternalEntities option, disabled by default, restores the previous behaviour.
The issue is classified as CWE-611 (Improper Restriction of XML External Entity Reference).