upatch.dev

CVE-2026-80344

Apache Camel: Camel-AS2 Server-Side Request Forgery and Credential Disclosure via Asynchronous MDN Delivery Address

Refuses outbound connections from Apache Camel AS2 request handler threads to loopback, link-local, and RFC 1918 addresses to mitigate CVE-2026-80344.

High 8.2Vetted

EPSS 0.9%: the estimated chance this CVE is exploited in the next 30 days, as of 24 Nov 2026.

At a glance

CVE-2026-80344 is a high (CVSS 8.2) vulnerability in Apache Camel, published 19 October 2026. A vetted upatch, cve-2026-80344-as2-ssrf-block, blocks it on running Linux machines with shirudo until Apache Camel is upgraded.

Severity
High 8.2 CVSS 3.1
Chance of exploitation
0.9% in the next 30 days (EPSS, 24 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-918
Affected software
Apache Camel (Apache Software Foundation)
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

CVE-2026-80344 is a server-side request forgery (SSRF) and credential disclosure vulnerability in the Apache Camel AS2 component (camel-as2), published on 19 October 2026 and tracked as CAMEL-24417. In the AS2 protocol, the sender of an inbound message can request an asynchronous receipt by supplying a delivery URL in the Receipt-Delivery-Option HTTP header. When ResponseMDN sees both Disposition-Notification-To and Receipt-Delivery-Option, it records that URL in the HTTP context, and AS2ServerConnection.RequestHandlerThread passes it to AS2AsynchronousMDNManager.send(), which opens a java.net.Socket to the host and port in the sender-supplied URI without checking them against an allow-list. A remote sender can therefore direct the Camel AS2 receiver to connect to internal services, loopback endpoints, or link-local metadata addresses, and receive any configured MDN credentials along with the HTTP POST request.

Official description

Server-Side Request Forgery (SSRF) vulnerability in Apache Camel AS2 component. This issue affects Apache Camel: from 4.0.0 before 4.18.5, from 4.19.0 before 4.22.1. In the AS2 protocol the sender of a message may request that the Message Disposition Notification be returned asynchronously to an address the sender supplies. camel-as2 took that address from the inbound message and used it as the destination for the outgoing receipt without constraining it to anything the deployment had configured. A remote partner therefore chose the host the Camel instance would connect to when delivering the MDN. That gives server-side request forgery from the position of the AS2 receiver, including reaching hosts that are only routable from inside the deployment's network, and where the outbound connection carries credentials configured for MDN delivery those credentials are presented to the attacker-chosen destination. Upgrade to Apache Camel 4.23.0, which fixes the issue. Users on the 4.18.x LTS releases stream should upgrade to 4.18.5. Users on the 4.22.x LTS releases stream should upgrade to 4.22.1. The asynchronous MDN destination is now constrained rather than taken verbatim from the inbound message. For deployments that cannot upgrade immediately, restrict outbound connectivity from the AS2 receiver to the partner endpoints it legitimately delivers receipts to, and do not attach credentials to MDN delivery that are valid for any host other than those partners.

Affected versions

Apache Camel camel-as2 / camel-as2-api:

Branch Affected Fixed in
4.18.x 4.0.0 to 4.18.4 4.18.5
4.22.x 4.19.0 to 4.22.0 4.22.1
4.23.x — 4.23.0

Kernels: any Linux kernel supported by shirudo with BPF LSM and BTF enabled (lsm/socket_connect).

Sources

More references from NVD (5)

Mitigation

One BPF LSM program on lsm/socket_connect returns -EPERM when all three conditions hold:

  1. The calling thread's command name (comm) starts with AS2Hdlr-, which AS2ServerConnection.RequestHandlerThread sets with setName("AS2Hdlr-" + getId()) before handling an inbound AS2 connection and delivering its asynchronous MDN.
  2. The destination socket address is an internal IPv4 or IPv6 address (or an IPv4-mapped IPv6 address for one): 0.0.0.0/8, 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 (including 169.254.169.254), ::, ::1, fc00::/7, or fe80::/10.
  3. The current task's executable (mm->exe_file) is named java.

A refusal from an earlier BPF LSM program on lsm/socket_connect is preserved. The refused per-CPU array map counts refused connection attempts at key 0.

Side effects

  • Asynchronous MDN delivery from an AS2ServerConnection handler thread to loopback, RFC 1918 private networks, link-local addresses, or unique local IPv6 addresses fails with a socket permission error (EPERM), while synchronous MDNs and inbound AS2 requests on the same connection complete normally.
  • Outbound connections from other threads in the same JVM (such as Camel routes forwarding received payloads or AS2ClientConnection senders) and from all other processes on the machine are unaffected because their thread names do not start with AS2Hdlr-.
  • Outbound asynchronous MDNs to public external IP addresses are not blocked by this upatch; operators who need to restrict external hosts or protect MDN credentials on external connections should upgrade and set asyncMdnAllowedHosts.
  • Not covered: a custom JVM launcher whose binary is not named java.

Preemption model and cost

The program keeps no shared state beyond the per-CPU refused counter, which it updates with __sync_fetch_and_add, making it safe under all kernel preemption models including PREEMPT_LAZY, PREEMPT_DYNAMIC, and PREEMPT_RT. On every socket_connect call outside an AS2 handler thread, the program runs a single bpf_get_current_comm() check on the first 8 bytes and returns 0 without reading the socket address or task structures.

The policy

139 lines of BPF C, attached at lsm/socket_connect.

// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause

#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_core_read.h>
#include <bpf/bpf_endian.h>

#define AF_INET		2
#define AF_INET6	10
#define EPERM		1

char _license[] SEC("license") = "Dual BSD/GPL";

struct {
	__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
	__uint(max_entries, 1);
	__type(key, __u32);
	__type(value, __u64);
} refused SEC(".maps");

static __always_inline void count_refused(void)
{
	__u32 key = 0;
	__u64 *value = bpf_map_lookup_elem(&refused, &key);

	if (value)
		__sync_fetch_and_add(value, 1);
}

static __always_inline bool is_as2_handler_comm(void)
{
	char comm[16] = {};

	if (bpf_get_current_comm(comm, sizeof(comm)) < 0)
		return false;
	return comm[0] == 'A' && comm[1] == 'S' && comm[2] == '2' &&
	       comm[3] == 'H' && comm[4] == 'd' && comm[5] == 'l' &&
	       comm[6] == 'r' && comm[7] == '-';
}

static __always_inline bool current_is_java(void)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);
	const unsigned char *name = BPF_CORE_READ(exe, d_name.name);
	char buf[8] = {};

	if (!exe || BPF_CORE_READ(exe, d_name.len) != 4 || !name)
		return false;
	if (bpf_probe_read_kernel_str(buf, sizeof(buf), name) < 0)
		return false;
	return buf[0] == 'j' && buf[1] == 'a' && buf[2] == 'v' && buf[3] == 'a' &&
	       buf[4] == 0;
}

static __always_inline bool ipv4_is_internal(__u32 ip)
{
	if ((ip & 0xff000000U) == 0x00000000U)
		return true;
	if ((ip & 0xff000000U) == 0x7f000000U)
		return true;
	if ((ip & 0xff000000U) == 0x0a000000U)
		return true;
	if ((ip & 0xfff00000U) == 0xac100000U)
		return true;
	if ((ip & 0xffff0000U) == 0xc0a80000U)
		return true;
	if ((ip & 0xffff0000U) == 0xa9fe0000U)
		return true;
	return false;
}

static __always_inline bool ipv6_is_internal(const struct in6_addr *addr)
{
	__u32 w0 = bpf_ntohl(addr->in6_u.u6_addr32[0]);
	__u32 w1 = bpf_ntohl(addr->in6_u.u6_addr32[1]);
	__u32 w2 = bpf_ntohl(addr->in6_u.u6_addr32[2]);
	__u32 w3 = bpf_ntohl(addr->in6_u.u6_addr32[3]);

	if (w0 == 0 && w1 == 0 && w2 == 0 && (w3 == 0 || w3 == 1))
		return true;
	if (w0 == 0 && w1 == 0 && w2 == 0x0000ffffU)
		return ipv4_is_internal(w3);
	if ((w0 & 0xfe000000U) == 0xfc000000U)
		return true;
	if ((w0 & 0xffc00000U) == 0xfe800000U)
		return true;
	return false;
}

static __always_inline bool dest_is_internal(struct sockaddr *address, int addrlen)
{
	sa_family_t family;

	if (!address || addrlen < (int)sizeof(sa_family_t))
		return false;
	if (bpf_probe_read_kernel(&family, sizeof(family), &address->sa_family))
		return false;
	if (family == AF_INET) {
		struct sockaddr_in sin = {};

		if (addrlen < (int)sizeof(sin))
			return false;
		if (bpf_probe_read_kernel(&sin, sizeof(sin), address))
			return false;
		return ipv4_is_internal(bpf_ntohl(sin.sin_addr.s_addr));
	}
	if (family == AF_INET6) {
		struct sockaddr_in6 sin6 = {};

		if (addrlen < (int)sizeof(sin6))
			return false;
		if (bpf_probe_read_kernel(&sin6, sizeof(sin6), address))
			return false;
		return ipv6_is_internal(&sin6.sin6_addr);
	}
	return false;
}

static __always_inline int earlier_verdict(int ret)
{
	return ret >= -4095 && ret < 0 ? ret : -EPERM;
}

SEC("lsm/socket_connect")
int BPF_PROG(cve_2026_80344_connect, struct socket *sock,
	     struct sockaddr *address, int addrlen, int ret)
{
	if (ret)
		return earlier_verdict(ret);
	if (!is_as2_handler_comm())
		return 0;
	if (!dest_is_internal(address, addrlen) || !current_is_java())
		return 0;
	count_refused();
	return -EPERM;
}

Process

How this upatch was written, checked and reviewed, from the registry’s history.

  1. 19 Oct 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #41 openedAdd CVE-2026-80344: Refuses outbound connections from Apache Camel AS2 request handler threads toromanlab
  3. 25 Nov 2026MergeMerged #41romanlab
  4. 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)

No human review is recorded on GitHub for this upatch yet.

Evidence

On a vulnerable Apache Camel camel-as2-api 4.22.0 AS2ServerConnection, the loaded upatch refused the asynchronous MDN callback to 127.0.0.1 while leaving inbound AS2 message receipt intact.

Tested
25 Nov 2026
Target
Apache Camel camel-as2-api 4.22.0 on OpenJDK 21, AS2ServerConnection listening on 127.0.0.1:18888
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Results
StateAsync MDN SSRF callback to 127.0.0.1Inbound AS2 POST status
Before loadingreached200
Upatch loadedblocked200
After unloadingreached200
tools-test.log Output of tools/test --setup for cve-2026-80344 across before, loaded, and after states.
tools/test --setup, 2026-11-25T12:05:37Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-80344
  setup   done         AS2_URL=http://127.0.0.1:18888/
  before  reached      Camel AS2 connected back to http://127.0.0.1:38803/mdn for asynchronous MDN delivery (HTTP 200)
  loaded  blocked      Camel AS2 accepted the message (HTTP 200) and made no asynchronous MDN connection to http://127.0.0.1:35465/mdn
  after   reached      Camel AS2 connected back to http://127.0.0.1:41477/mdn for asynchronous MDN delivery (HTTP 200)
  PASS: reached before, blocked while loaded, reached again after

Use it

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-80344
Publish and roll out
shirudo bpm push build/packages/cve-2026-80344-1.0.0.bee oci://<registry>/<namespace>/cve-2026-80344 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-80344-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>