Skip to content

Reject unterminated FlexBuffers keys during verification#9011

Open
steadytao wants to merge 1 commit intogoogle:masterfrom
steadytao:fix-9008-reject-unterminated-flexbuffer-keys
Open

Reject unterminated FlexBuffers keys during verification#9011
steadytao wants to merge 1 commit intogoogle:masterfrom
steadytao:fix-9008-reject-unterminated-flexbuffer-keys

Conversation

@steadytao
Copy link
Copy Markdown

Summary

Reject malformed FlexBuffers keys that are not NUL-terminated within the buffer.

Problem

VerifyKey() returned success after encountering any non-zero byte, which allowed malformed FBT_KEY values without a terminating NUL byte to pass VerifyBuffer().

Fix

Require a NUL terminator before the end of the buffer and add a regression test for the 4-byte malformed input from issue #9008.

Testing

  • built & ran flattests.exe
  • all tests passed

Fixes #9008

VerifyKey() returned success after encountering any non-zero byte, which allowed malformed FBT_KEY values without a terminating NUL byte to pass VerifyBuffer().

Require a NUL terminator before the end of the buffer and add a regression test for the 4-byte malformed input from issue google#9008.

Tested with flattests.exe; all tests passed.
@steadytao steadytao requested a review from dbaileychess as a code owner April 3, 2026 02:27
@github-actions github-actions bot added the c++ label Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Heap buffer overflow in FlexBuffers ToString via strlen (4-byte PoC)

1 participant