CVE-2026-40047 Details
Description
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') vulnerability in Apache Camel Docling component. The camel-docling component invokes the external `docling` command-line tool by assembling an argument list in DoclingProducer and executing it through java.lang.ProcessBuilder. Custom CLI arguments supplied through the `CamelDoclingCustomArguments` exchange header (a List<String>) were appended to that argument list with insufficient validation: the original implementation relied on a denylist of disallowed flags and only rejected path values that contained a literal `../` sequence. As a result, a Camel route that forwards externally-influenced data into the `CamelDoclingCustomArguments` header (or into the path-bearing headers used to build the invocation) could cause the producer to pass unrecognized or unintended `docling` CLI flags to the subprocess, and could supply path-like argument values that resolved outside the intended directory through traversal sequences not caught by the literal `../` check. Because Camel itself builds the `docling` invocation from these values, the component is responsible for constraining them, and the weak validation allowed CLI-argument injection and directory traversal in the arguments passed to the external tool. The invocation uses the list-based form of ProcessBuilder, so a shell does not interpret the argument values; OS command injection through shell metacharacters was not possible, and the metacharacter rejection added by the fix is defense-in-depth. This issue affects Apache Camel: from 4.15.0 before 4.18.3. Users are recommended to upgrade to a release that contains the CAMEL-23212 fix. On the mainline the fix is included from Apache Camel 4.19.0 (and later releases such as 4.20.0). For users on the 4.18.x LTS releases stream, upgrade to 4.18.3. The fix replaces the denylist with a strict allowlist of recognized `docling` CLI flags (rejecting any unrecognized flag, and rejecting producer-managed flags such as the output-directory flags), defensively rejects shell metacharacters in argument values, and normalizes path-like values with Path.normalize() before validating them so that traversal sequences which bypass a literal `../` check are detected. As defence in depth, route authors should avoid mapping untrusted message content into the `CamelDoclingCustomArguments` header and the path-bearing headers, and should strip Camel-internal headers from messages that arrive from untrusted producers.
A vulnerability allowing improper validation of custom command-line interface (CLI) arguments has been identified in the Apache Camel Docling component, versions 4.15.0 prior to 4.18.3. This vulnerability arises because the component invokes the external 'docling' command-line tool by creating an argument list in the DoclingProducer and executing it via ProcessBuilder. Custom CLI arguments provided through the 'CamelDoclingCustomArguments' exchange header were added to the argument list without adequate validation. The original approach relied on a denylist of disallowed flags and only rejected path values containing a literal '../' sequence. Consequently, a Camel route that transmits externally-influenced data into the 'CamelDoclingCustomArguments' header or the path-bearing headers used for the invocation could lead to the injection of unrecognized or unintended 'docling' CLI flags into the subprocess. Additionally, it could allow the inclusion of path-like argument values that resolved outside the intended directory by exploiting traversal sequences not detected by the literal '../' check. Since Camel constructs the 'docling' invocation from these values, the component must properly constrain them. The inadequate validation permitted CLI-argument injection and directory traversal in the arguments sent to the external tool. Although the invocation uses the list-based form of ProcessBuilder, preventing interpretation of argument values by a shell and thereby avoiding OS command injection through shell metacharacters, this vulnerability still poses a significant risk.
Users are advised to upgrade to Apache Camel versions 4.18.3 or 4.19.0 and later. The fix involves replacing the denylist with a strict allowlist of recognized 'docling' CLI flags, defensively rejecting shell metacharacters in argument values, and normalizing path-like values before validation to detect traversal sequences that bypass a literal '../' check. As an additional precaution, route authors should avoid using untrusted message content in the 'CamelDoclingCustomArguments' header and related path-bearing headers, and should remove Camel-internal headers from messages from untrusted producers.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 6, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| http://www.openwall.com/lists/oss-security/2026/07/05/2 | CVE | Mailing ListThird Party Advisory |
| https://camel.apache.org/security/CVE-2026-40047.html | [email protected] | Vendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-88 | Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| apache camel | >= 4.15.0, < 4.18.3 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 8, 2026 | Initial Analysis | [email protected] |
| Jul 6, 2026 | CVE Modified | CISA-ADP |
| Jul 6, 2026 | CVE Modified | CVE |
| Jul 6, 2026 | New CVE Received | [email protected] |