---
id: "CVE-2026-74757"
kind: "vulnerability"
aliases: ["CVE-2026-74757"]
title: "Apache bRPC: crafted mcpack request forces huge memory allocation and crash"
severity: "high"
cvss: null
epss: 0.00242
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["apache-brpc", "bpc", "c++", "nshead", "package", "ubrpc"]
not_affected_if: ["not-using-mcpack2pb", "version-1.18.0-or-later"]
published_at: "2026-10-21T12:17:22+00:00"
first_seen_at: "2026-10-23T21:57:28+00:00"
updated_at: "2026-10-25T05:02:39+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-74757", "first_seen_at": "2026-10-23T21:57:28+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-74757", "first_seen_at": "2026-10-24T13:15:54+00:00"}]
---

# Apache bRPC: crafted mcpack request forces huge memory allocation and crash

A crafted mcpack request with a huge array item count makes the bRPC server preallocate a very large amount of memory, which can abort the process. An unauthenticated remote attacker can trigger it because the body is parsed before authentication.

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

## How to check

- Check whether the service uses bRPC with `NsheadService` and `UbrpcMcpack2Adaptor` (the ubrpc deployment pattern) and code generated by the mcpack2pb protoc plugin.
- Check the bRPC version in use; affected versions are below `1.18.0`.

## Fix

- Upgrade bRPC to `1.18.0`.
- Or apply the patch from https://github.com/apache/brpc/pull/3451.

## Timeline

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

## From the sources

Uncontrolled resource allocation in the mcpack2pb component in Apache bRPC (version < 1.18.0) on all platforms allows remote attackers to make the server allocate a large amount of memory via sending a crafted mcpack request with a huge array item count.

Root Cause:
The bRPC mcpack2pb parser trusts the item count stored in the mcpack array header without validating it against the actual payload size. The code generated by the mcpack2pb protoc plugin uses this count to preallocate memory for repeated protobuf fields via Reserve(). A malformed request declaring item_count = 0x7fffffff can force the server to preallocate about 16GB of virtual memory, which may abort the process (SIGABRT) on memory-constrained hosts.

Affected Scenarios:
Use a bRPC server that wires a NsheadService to UbrpcMcpack2Adaptor (the Baidu ubrpc deployment pattern) and parses requests with code generated by the mcpack2pb protoc plugin. The request body is parsed before authentication.

How to Fix:
(Choose one of the following options)
1. Upgrade bRPC to version 1.18.0, which fixes this issue.
2. Apply this patch:  https://github.com/apache/brpc/pull/3451 

Note:
No matter which option you choose, you should know that the fix caps the array item count to the remaining bytes of the array payload.

---

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