Skip to content

v1.0.1

Choose a tag to compare

@khanaffan khanaffan released this 05 Apr 12:21
· 36 commits to main since this release

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 for str32/bin32/ext32 types where (i+sz<=n) could wrap u32, causing mpSkipOne to return positions before the cursor. Also fixed off-by-one header checks for ext8/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 in mpToJsonAt and mpMergePatch.
  • Output buffer cap (MP_MAX_OUTPUT=64MB): Prevents OOM from adversarial inputs that cause exponential output growth.
  • Integer overflow fix in mpBufAppend/mpBufReserve size calculations.

Fuzz Testing Infrastructure

  • tests/fuzz_msgpack.c: libFuzzer harness exercising all 15+ SQL entry points
  • tests/fuzz_corpus/: 42 seed inputs covering every msgpack format type
  • CMakeLists.txt: MSGPACK_BUILD_FUZZ=ON option (requires Clang with libFuzzer)

Validated with 1.1M+ fuzzer iterations under AddressSanitizer with zero crashes.