| Título | Tencent RapidJSON 1.1.0 Memory Corruption |
|---|
| Descrição | A critical vulnerability has been identified in Tencent RapidJSON through version 1.1.0 and git master (commit 24b5e7a).
The vulnerability affects the function Writer::WriteString located in include/rapidjson/writer.h (lines 397-402). When reserving memory for string serialization, the reservation calculation:
PutReserve(*os_, 2 + length * 12);
is evaluated using 32-bit unsigned arithmetic (SizeType). For string lengths of 357,913,942 characters or more, this multiplication wraps modulo 2^32, requesting only 10 bytes of buffer reservation while the default buffer capacity is 256 bytes.
In production builds and downstream distribution packages compiled with -DNDEBUG, Stack::PushUnsafe assertions are compiled out. The writer then copies over 357 MB of string data into the 256-byte buffer without bounds checking. This leads to an extensive heap buffer overflow that allows an attacker to corrupt adjacent memory and hijack control flow to achieve arbitrary code execution.
The underlying integer overflow was noted in upstream issues #2336 and #2348 as a denial of service / assertion crash, and fix pull request #2396 was closed unmerged on 2026-10-05. The escalation to arbitrary code execution in release builds is newly identified.
Remediation requires widening length to size_t:
PutReserve(*os_, 2 + static_cast<size_t>(length) * 12);
Coordinated disclosure is underway with CERT/CC (Tracking ID: VRF#26-10-WMJBQ). |
|---|
| Fonte | ⚠️ https://github.com/Tencent/rapidjson/issues/2336 |
|---|
| Utilizador | 0xtoxic (UID 102605) |
|---|
| Submissão | 29/10/2026 07h48 (há 28 dias) |
|---|
| Moderação | 26/11/2026 10h06 (28 days later) |
|---|
| Estado | Aceite |
|---|
| Entrada VulDB | 444244 [Tencent RapidJSON até 1.1.0 writer.h Writer::WriteString length Excesso de tampão] |
|---|
| Pontos | 20 |
|---|