Skip to content

Fix missing boundary validation in Go Table.VectorLen#9146

Open
owvr27 wants to merge 1 commit into
google:masterfrom
owvr27:fix-go-vectorlen-bounds
Open

Fix missing boundary validation in Go Table.VectorLen#9146
owvr27 wants to merge 1 commit into
google:masterfrom
owvr27:fix-go-vectorlen-bounds

Conversation

@owvr27

@owvr27 owvr27 commented Jun 20, 2026

Copy link
Copy Markdown

Description

This PR introduces missing boundary verification within the Go runtime implementation (go/table.go), specifically targeting the Table.VectorLen function.

Technical Details

Prior to this patch, VectorLen executed offset increments and direct array slicing (t.Bytes[off:]) without verifying constraints against len(t.Bytes). This introduced an architectural consistency gap compared to safe functions like ByteVector. Processing a malformed or truncated binary payload would immediately trigger an unhandled slice bounds out of range runtime panic, resulting in a Remote Denial of Service (DoS) for downstream Go services.

This fix applies identical rigid guards as ByteVector, safely returning 0 when encountering invalid offsets while preserving FlatBuffers' zero-allocation design. All native test suites passed successfully via GoTest.sh.

@owvr27 owvr27 requested a review from dbaileychess as a code owner June 20, 2026 17:02
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.

1 participant