Repository navigation
v1.0.1
Security & Robustness Fixes
This release fixes multiple memory safety vulnerabilities found via fuzz testing and adds a libFuzzer harness for ongoing use.
Bug Fixes
-
Heap-buffer-overflow in
msgpack_to_json(): Map/array loops now break early when the cursor reaches the end of the blob, preventing hangs and null-emission on truncated containers. String/binary decoders now clamp payload lengths to the remaining buffer. -
Heap-buffer-overflow in
mpSkipOne(): Fixed integer overflow in bounds checks forstr32/bin32/ext32types where(i+sz<=n)could wrap u32, causingmpSkipOneto return positions before the cursor. Also fixed off-by-one header checks forext8/ext16/ext32. -
Heap-buffer-overflow in
mpToJsonAt(): Added missing bounds checks before reading integer and float values (uint8–int64,float32/float64) from truncated elements. -
Heap-buffer-overflow in
mpMergePatch(): Added missing bounds checks on MAP16/MAP32 header reads and loop cursor guards in both key-scan phases.
Hardening
- Recursion depth limit (
MP_MAX_DEPTH=200): Prevents stack overflow on deeply nested structures inmpToJsonAtandmpMergePatch. - Output buffer cap (
MP_MAX_OUTPUT=64MB): Prevents OOM from adversarial inputs that cause exponential output growth. - Integer overflow fix in
mpBufAppend/mpBufReservesize calculations.
Fuzz Testing Infrastructure
tests/fuzz_msgpack.c: libFuzzer harness exercising all 15+ SQL entry pointstests/fuzz_corpus/: 42 seed inputs covering every msgpack format typeCMakeLists.txt:MSGPACK_BUILD_FUZZ=ONoption (requires Clang with libFuzzer)
Validated with 1.1M+ fuzzer iterations under AddressSanitizer with zero crashes.