Skip to content

Harden ValueReader (backport #2007)#2008

Merged
acogoluegnes merged 2 commits into
v5.xfrom
mergify/bp/v5.x/pr-2007
Jul 6, 2026
Merged

Harden ValueReader (backport #2007)#2008
acogoluegnes merged 2 commits into
v5.xfrom
mergify/bp/v5.x/pr-2007

Conversation

@mergify

@mergify mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown

This is an automatic backport of pull request #2007 done by [Mergify](https://mergify.com).

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.

(cherry picked from commit 6a87a8d)
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.

(cherry picked from commit 09af76f)
@mergify mergify Bot mentioned this pull request Jul 6, 2026
@acogoluegnes acogoluegnes added this to the 5.33.1 milestone Jul 6, 2026
@acogoluegnes acogoluegnes merged commit 1221b25 into v5.x Jul 6, 2026
4 of 6 checks passed
@acogoluegnes acogoluegnes deleted the mergify/bp/v5.x/pr-2007 branch July 6, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant