---
id: "CVE-2026-56387"
kind: "vulnerability"
aliases: ["CVE-2026-56387"]
title: "Apache bRPC: RTMP AMF parser allocates memory from attacker-declared lengths"
severity: "unknown"
cvss: null
epss: 0.00274
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["apache-brpc", "c++", "package", "rtmp", "self-hosted"]
not_affected_if: ["rtmp-disabled", "trusted-clients-only"]
published_at: "2026-10-21T12:17:21+00:00"
first_seen_at: "2026-10-23T21:57:28+00:00"
updated_at: "2026-10-25T05:02:51+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-56387", "first_seen_at": "2026-10-23T21:57:28+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-56387", "first_seen_at": "2026-10-24T13:15:54+00:00"}]
---

# Apache bRPC: RTMP AMF parser allocates memory from attacker-declared lengths

The RTMP AMF parser in Apache bRPC trusts string lengths and array counts declared in incoming data before checking the payload holds that many bytes. A remote unauthenticated attacker can send a small payload that forces excessive memory allocation or resource use, causing denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check whether the bRPC server has the RTMP component enabled and accepts RTMP traffic from untrusted clients.
- Check the bRPC version in use, for example with `grep -r 'BRPC_VERSION\|brpc' CMakeLists.txt` or your package manager, and compare it with `1.18.0`.

## Fix

- Upgrade bRPC to `1.18.0`.
- Or apply the patch from https://github.com/apache/brpc/pull/3353.
- Tune `amf_max_string_size` (default 64 MiB) and `amf_max_array_size` (default 1,048,576) if the defaults do not fit your workload.

## Timeline

- 2026-10-23T21:57:28+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-56387
- 2026-10-24T13:15:54+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-56387

## From the sources

The RTMP AMF parser in Apache bRPC accepts AMF string lengths and array counts directly from untrusted input. A remote unauthenticated attacker who can reach a bRPC server with RTMP enabled can send a small AMF payload with an excessive declared long string length or array count, causing excessive memory allocation or resource consumption before the parser rejects the incomplete payload.

Root Cause:
The AMF long string parser resized the destination string to the declared 32-bit length before validating that the stream contained that many bytes. ECMA array and strict array parsers also accepted 32-bit element counts without a configurable upper bound.

Affected Scenarios:
Deployments that enable the bRPC RTMP server component and accept RTMP traffic from untrusted clients. Direct uses of the AMF parser on untrusted data are also affected.

How to Fix:
1. Upgrade bRPC to version 1.18.0, which fixes this issue.
2. Apply this patch:  https://github.com/apache/brpc/pull/3353 

Note:
The fix introduces configurable AMF parsing limits. The default maximum string size is 64 MiB and the default maximum array element count is 1,048,576. Payloads above these limits are rejected. The limits can be adjusted with amf_max_string_size and amf_max_array_size.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
