VYPR
Unrated severityNVD Advisory· Published Mar 10, 2020· Updated Aug 4, 2024

CVE-2019-3553

CVE-2019-3553

Description

C++ Facebook Thrift servers would not error upon receiving messages declaring containers of sizes larger than the payload. As a result, malicious clients could send short messages which would result in a large memory allocation, potentially leading to denial of service. This issue affects Facebook Thrift prior to v2020.02.03.00.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

24

Patches

Vulnerability mechanics

Root cause

"Missing bounds check before memory allocation: the server trusts the declared size of containers and strings without verifying that the remaining payload is sufficient to hold the declared number of elements."

Attack vector

A malicious client sends a Thrift message that declares a container (list, set, map) or string with a size field that is much larger than the actual payload bytes that follow. The server trusts the declared size and attempts to allocate memory for the full container before reading the elements. Because the declared size can be arbitrarily large while the actual message is short, the server may allocate an enormous buffer, leading to memory exhaustion and denial of service. No authentication is required; the attacker only needs network access to a vulnerable Thrift endpoint.

Affected code

The vulnerability exists in the container-reading logic of Facebook Thrift's protocol layer. The patch adds `canReadNElements()` checks in `protocol_methods` for `list`, `set`, and `map` types (ref_id=1), and adds `in_.canAdvance(size)` checks in `BinaryProtocolReader::readStringBody` and `CompactProtocolReader::readStringBody` for string fields (ref_id=2). A new `throwTruncatedData()` static method on `TProtocolException` is introduced to signal the error.

What the fix does

The fix adds a lightweight lower-bound check — `canReadNElements()` — before reading list, set, and map elements (ref_id=1). This function verifies that the remaining buffer contains at least `n * sizeof(element_type)` bytes. If the check fails, `throwTruncatedData()` is called, which raises a `TProtocolException` with the message "Not enough bytes to read the entire message, the data appears to be truncated". Similarly, string readers in both `BinaryProtocolReader` and `CompactProtocolReader` now call `in_.canAdvance(size)` before reserving memory (ref_id=2). These checks prevent the server from committing to a large allocation when the payload is demonstrably too short.

Preconditions

  • networkNetwork access to a vulnerable Facebook Thrift server (prior to v2020.02.03.00)
  • inputAbility to send a crafted Thrift message with a container or string size field larger than the actual payload

Generated on Jun 1, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

3

News mentions

0

No linked articles in our index yet.