Apache Camel `camel-consul` ConsulRegistry Deserialization RCE (CVE-2026-27172)
by oscerd (Andrea Cosentino) · 2026-07-06
- Severity
- Critical
- CVE
- CVE-2026-27172
- Category
- web
- Affected product
- Apache Camel camel-consul component (org.apache.camel.component.consul.ConsulRegistry)
- Affected versions
- From 3.0.0 before 4.14.6, and from 4.15.0 before 4.18.1
- Disclosed
- 2026-07-06
- Patch status
- unpatched
Tags
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-06 |
| Last Updated | 2026-07-06 |
| Author / Researcher | oscerd (Andrea Cosentino) |
| CVE / Advisory | CVE-2026-27172 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.8 (per Apache Camel security advisory) |
| Status | Patched |
| Tags | apache-camel, camel-consul, consulregistry, java-deserialization, rce, cwe-502, gadget-chain, ysoserial, spring-boot |
| Related | CVE-2024-22369, CVE-2024-23114, CVE-2026-25747 |
Affected Target
| Field | Value |
|---|---|
| Software / System | Apache Camel camel-consul component (org.apache.camel.component.consul.ConsulRegistry) |
| Versions Affected | From 3.0.0 before 4.14.6, and from 4.15.0 before 4.18.1 |
| Language / Platform | Java 17+, Spring Boot, Apache Camel, HashiCorp Consul (KV store) |
| Authentication Required | No (requires write access to the backing Consul KV store) |
| Network Access Required | Yes |
Summary
Apache Camel’s camel-consul component uses a Consul key/value store as a Camel bean registry (ConsulRegistry). When a bean is looked up by name, ConsulRegistryUtils.deserialize() Base64-decodes the stored KV value and deserializes it with a raw ObjectInputStream and, in affected versions, no ObjectInputFilter. Any principal able to write to the Consul KV path used by the registry can plant a Java gadget-chain payload (e.g. via commons-collections) that executes arbitrary code the next time Camel resolves that bean — through lookupByName(), lookupByNameAndType(), findByTypeWithName(), or findByType(). This is the same root-cause class of bug as CVE-2024-22369 (Cassandra-backed registry) and CVE-2024-23114 / CVE-2026-25747 (LevelDB-backed registry), which were overlooked when camel-consul was audited during those earlier fixes.
Vulnerability Details
Root Cause
ConsulRegistryUtils.deserialize() reads Consul KV values and calls ObjectInputStream.readObject() directly with no class allow-list/filter:
| |
Attack Vector
- Obtain write access to the Consul KV path backing the Camel registry (shared/misconfigured Consul cluster, over-scoped ACL token, or a separate vulnerability providing a KV write primitive).
- Generate a serialized gadget-chain payload with
ysoserial(e.g.CommonsCollections7), Base64-encode it (ConsulRegistrystores values as Base64). - Overwrite the KV entry under the key that a Camel route/bean reference resolves by name.
- When Camel resolves that bean — via
.to("bean:..."),bean(...),.process("..."), startup registry resolution, or afindByType()scan —ConsulRegistryBase64-decodes and deserializes the KV value with no filter, executing the gadget chain.
Impact
Remote code execution on the host running the Camel application, requiring only KV write access to the Consul store backing the registry (no authentication to the Camel application itself).
Environment / Lab Setup
Target: Spring Boot app using camel-consul-starter 4.18.0 (affected) as its Camel registry
Backing: HashiCorp Consul agent (KV store), e.g. `docker run -d -p 8500:8500 hashicorp/consul:1.17 agent -dev -client 0.0.0.0`
Attacker: Java 17+, Maven 3.8+, ysoserial (gadget payload generation)
Gadget: commons-collections 3.2.1 on the application classpath
Proof of Concept
PoC Application
See
pom.xmlandsrc/main/java/com/example/in this folder — a minimal Spring Boot app exposing REST endpoints (ExploitController) that driveConsulRegistrydirectly, so the PoC is self-contained and does not require a live Camel route.
| |
lookupByName() reads the KV value, Base64-decodes it, and deserializes it via a raw ObjectInputStream — executing the gadget chain during readObject(), before the returned value is ever used.
Detection & Indicators of Compromise
Signs of compromise:
- Unexpected writes to the Consul KV path used by a Camel
ConsulRegistry, especially from tokens/identities that shouldn’t have registry write access - The Camel application process spawning shell children or unexpected file/network activity correlated with a registry lookup (
lookupByName,findByType, etc.) commons-collectionsor other known ysoserial gadget libraries present on the classpath of a production Camel application
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade camel-consul to 4.14.6, 4.18.1, or 4.19.0 (CAMEL-23029), which adds a configurable ObjectInputFilter (default java.**;org.apache.camel.**;!*) to ConsulRegistryUtils.deserialize() via a new deserializationFilter option |
| Interim mitigation | Restrict Consul KV write access to the Camel application’s own identity (least-privilege ACL tokens); remove gadget libraries such as commons-collections 3.x from the classpath where possible; isolate the Consul cluster on a trusted network |
References
Notes
Mirrored from https://github.com/oscerd/CVE-2026-27172 on 2026-07-06. Same root-cause class as CVE-2024-22369 (Cassandra registry), CVE-2024-23114 and CVE-2026-25747 (LevelDB registry), all overlooked during earlier camel-jsch/registry deserialization remediations and fixed the same way (an ObjectInputFilter allow-list).