🐛 bug: apply limits to msgp serialization#4067
Closed
Copilot wants to merge 1 commit intoadd-msgp-limits-to-generated-sourcesfrom
Closed
🐛 bug: apply limits to msgp serialization#4067Copilot wants to merge 1 commit intoadd-msgp-limits-to-generated-sourcesfrom
Copilot wants to merge 1 commit intoadd-msgp-limits-to-generated-sourcesfrom
Conversation
Copilot
AI
changed the title
[WIP] Fix limits applied to msgp serialization
🐛 bug: apply limits to msgp serialization
Feb 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Prevent msgp limit tags from unnecessarily constraining cache and idempotency payloads whose sizes are governed by storage policy rather than serializer limits. Keep per-field caps for headers and other small fields to protect against unbounded memory usage during deserialization. Regenerate msgp outputs so runtime decoding enforces the intended limits and fails fast on malicious inputs.
Changes introduced
cache.item.bodyandidempotency.response.Body, deferring body-size enforcement to storage policy while retaining field-level limits for headers and metadata fields.Headers) to1024and tightened per-field byte limits forctype,cencoding,cacheControl,expires,etag, and header key/value sizes.//msgp:limit arrays:256 maps:32 marshal:truefor cookie-based redirect payloads (constrained by ~4KB cookie limits).*_msgp.gofiles to include size-constant checks,ReadBytesLimit/ReadBytesHeadervariants, and explicitmsgp.ErrLimitExceededchecks.//nolint:reviveannotations where msgp tags on unexported fields require linter exceptions.No additional limits needed for csrf (empty struct), limiter (fixed-size primitives only), or session (msgp-ignored).
Type of change
Checklist
/docs/directory for Fiber's documentation.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.