Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40858

CVE-2026-40858: Apache Camel RCE Vulnerability

CVE-2026-40858 is a remote code execution vulnerability in Apache Camel's camel-infinispan component that allows attackers to execute arbitrary code. This post explains its impact, affected versions, and mitigation steps.

Updated:

CVE-2026-40858 Overview

CVE-2026-40858 is an insecure deserialization vulnerability [CWE-502] in the Apache Camel camel-infinispan component. The ProtoStream-based remote aggregation repository reads cached objects with java.io.ObjectInputStream and applies no ObjectInputFilter. An attacker with write access to the backing Infinispan cache can plant a crafted serialized Java object. When the Camel application performs normal aggregation operations such as get or recover, the gadget chain executes arbitrary code in the application's context. The flaw affects Apache Camel 4.0.0 through 4.14.6, 4.15.0 through 4.18.1, and 4.19.0. It follows the same class of issues previously tracked as CVE-2024-22369, CVE-2024-23114, and CVE-2026-25747.

Critical Impact

Successful exploitation yields arbitrary Java code execution within the Camel application process, breaching confidentiality, integrity, and availability of integration pipelines and connected systems.

Affected Products

  • Apache Camel 4.0.0 through 4.14.6 (upgrade to 4.14.7)
  • Apache Camel 4.15.0 through 4.18.1 (upgrade to 4.18.2)
  • Apache Camel 4.19.0 (upgrade to 4.20.0)

Discovery Timeline

  • 2026-04-27 - CVE-2026-40858 published to NVD
  • 2026-04-28 - Last updated in NVD database

Technical Details for CVE-2026-40858

Vulnerability Analysis

The camel-infinispan component provides an aggregation repository that persists in-flight exchange state to a remote Infinispan cache. The ProtoStream-based remote variant reads previously stored values back into Java objects using java.io.ObjectInputStream. Apache Camel did not register an ObjectInputFilter to constrain which classes the stream could instantiate.

Any attacker who can write entries to the shared Infinispan cache controls the byte stream that Camel will later deserialize. By staging a serialized gadget chain drawn from libraries on the Camel application classpath, the attacker triggers method invocations that culminate in arbitrary code execution. Execution occurs inside the Camel process, inheriting its filesystem, network, and credential context.

Root Cause

The root cause is unrestricted Java deserialization on data fetched from an external trust boundary. The aggregation repository treated the Infinispan cache as trusted storage and passed its contents directly to ObjectInputStream.readObject(). Without a class allowlist, the JVM resolves and constructs any serializable type on the classpath, enabling well-known gadget chains.

Attack Vector

Exploitation requires write access to the Infinispan cache that the Camel route uses for aggregation. This access can come from a compromised microservice, a misconfigured cache exposed on the network, weak Infinispan authentication, or an adjacent tenant in a shared cluster. Once the attacker writes the malicious entry, deserialization is triggered automatically the next time Camel calls get, recover, or related repository operations during aggregation processing. No user interaction is required, and the attacker needs only low-privileged access to reach the cache.

No public proof-of-concept code is currently available. Refer to the Apache Camel CVE-2026-40858 Advisory and the linked Apache JIRA ticket CAMEL-23322 for the resolving commits and additional technical detail.

Detection Methods for CVE-2026-40858

Indicators of Compromise

  • Unexpected child processes spawned by the Java process hosting Camel routes, particularly shells, curl, wget, or scripting interpreters.
  • Infinispan cache entries containing Java serialization magic bytes (0xAC ED 00 05) in keys or values that should hold ProtoStream-encoded aggregation state.
  • Outbound network connections from the Camel application to unfamiliar hosts shortly after aggregation route activity.
  • ClassNotFoundException or unusual ObjectInputStream stack traces in application logs referencing gadget classes such as those from Commons Collections or similar libraries.

Detection Strategies

  • Inventory all running Camel deployments and confirm whether routes use InfinispanRemoteAggregationRepository or related ProtoStream-backed repositories.
  • Inspect cached values for non-ProtoStream payloads, especially serialized Java objects, which should not appear in this repository format.
  • Hunt for process-tree anomalies where the JVM running Camel launches OS-level processes, a pattern that aggregation workloads do not normally produce.

Monitoring Recommendations

  • Enable Infinispan server access and audit logs to record which clients write keys consumed by Camel aggregation repositories.
  • Forward Camel application logs and JVM telemetry to a centralized analytics platform and alert on deserialization errors or new outbound connections from aggregation handler threads.
  • Track Apache Camel and Infinispan client library versions in software composition analysis tooling so vulnerable releases are flagged automatically.

How to Mitigate CVE-2026-40858

Immediate Actions Required

  • Upgrade Apache Camel to 4.20.0. For supported branches, upgrade to 4.14.7 on the 4.14.x LTS line or 4.18.2 on the 4.18.x line.
  • Restrict write access to the Infinispan cache used by Camel to authenticated, least-privileged service identities only.
  • Review recent cache contents and application logs for evidence of exploitation prior to patching.
  • Rotate credentials and secrets accessible to the Camel process if compromise is suspected.

Patch Information

Apache has released fixed versions that introduce proper handling around the deserialization path in the camel-infinispan aggregation repository. Upgrade paths are 4.14.7, 4.18.2, and 4.20.0. The fix commits are referenced from Apache JIRA ticket CAMEL-23322 and the Apache Camel CVE-2026-40858 Advisory.

Workarounds

  • If immediate upgrade is not feasible, segment the Infinispan cluster on a private network and enforce strong client authentication to prevent unauthorized writes.
  • Configure a JVM-wide ObjectInputFilter via the jdk.serialFilter system property to reject all classes not strictly required by the Camel application.
  • Disable or replace ProtoStream-based remote aggregation repositories with alternative aggregation backends until patched versions are deployed.
bash
# Configuration example: restrict Java deserialization with a global allowlist
# Reject everything by default; permit only specific required classes.
export JAVA_TOOL_OPTIONS="-Djdk.serialFilter='maxbytes=16384;maxdepth=20;maxrefs=1000;!*'"

# Upgrade Apache Camel dependency (Maven example)
mvn versions:use-dep-version \
  -Dincludes=org.apache.camel:camel-infinispan \
  -DdepVersion=4.20.0 \
  -DforceVersion=true

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.