Skip to content

Harden ValueReader#2007

Merged
acogoluegnes merged 2 commits into
mainfrom
value-reader-hardening
Jul 6, 2026
Merged

Harden ValueReader#2007
acogoluegnes merged 2 commits into
mainfrom
value-reader-hardening

Conversation

@acogoluegnes

Copy link
Copy Markdown
Contributor

No description provided.

readBytes trusted the length prefix from the wire and allocated a
buffer of that size before confirming the stream actually contained
that many bytes. It now checks the declared length against what is
available and throws MalformedFrameException otherwise.

Add ValueReaderTest with coverage for long strings and field values.
readTable and readArray recursed into readFieldValue without any
bound on how deeply tables and arrays could nest inside each other.
Add a maximum nesting depth, throwing MalformedFrameException once
it is exceeded. The limit is 32 levels of nesting.

Add ValueReaderTest with coverage for nested tables and arrays, and
for reading byte vectors whose declared length exceeds available
data.
@acogoluegnes acogoluegnes marked this pull request as ready for review July 6, 2026 09:38
@acogoluegnes acogoluegnes merged commit f007f77 into main Jul 6, 2026
7 of 9 checks passed
@acogoluegnes acogoluegnes deleted the value-reader-hardening branch July 6, 2026 09:38
@acogoluegnes

Copy link
Copy Markdown
Contributor Author

@Mergifyio backport v5.x

@mergify

mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown

backport v5.x

✅ Backports have been created

Details

acogoluegnes added a commit that referenced this pull request Jul 6, 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.

1 participant