Skip to content

[v26.1.x] kafka/protocol: bound parse_tags by remaining message bytes - #30196

Merged
rockwotj merged 1 commit into
redpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30191-v26.1.x-979
Apr 16, 2026
Merged

[v26.1.x] kafka/protocol: bound parse_tags by remaining message bytes#30196
rockwotj merged 1 commit into
redpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30191-v26.1.x-979

Conversation

@vbotbuildovich

Copy link
Copy Markdown
Collaborator

Backport of PR #30191

parse_tags now takes a max_bytes parameter and checks two limits
before allocating each tagged field:

1. A cumulative budget check: the field length cannot exceed the
   bytes remaining in the message. Both callers already have a
   validated total message size (connection_context has sz from
   parse_size; transport has bytes_remaining), so this bound is
   derived from actual data rather than a hardcoded constant.

2. A per-field cap of 128 KiB, retained as a sanity limit on any
   single field.

All exceptions are now net::parsing_exception subclasses so the
server classifies them as parse-error disconnects rather than
unexpected errors.

(cherry picked from commit 17b5168)
@vbotbuildovich vbotbuildovich added this to the v26.1.x-next milestone Apr 16, 2026
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Apr 16, 2026
@vbotbuildovich
vbotbuildovich requested a review from rockwotj April 16, 2026 17:05
@rockwotj
rockwotj enabled auto-merge April 16, 2026 17:06
@rockwotj
rockwotj merged commit 1790c0d into redpanda-data:v26.1.x Apr 16, 2026
20 checks passed
@tyson-redpanda tyson-redpanda modified the milestones: v26.1.x-next, v26.1.6 May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build area/redpanda kind/backport PRs targeting a stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants