Repository navigation
bound search proxy query array - #1995
Merged
Merged
Conversation
zod collected an issue for every invalid element of an unbounded array, so a few MB of request body allocated gigabytes. Queries are now capped at 10, and zod is bumped to 4.6.7, which checks the length before the elements.
zod 4.6 no longer treats keys whose schema accepts undefined (like z.any()) as optional, so log entries without a payload would have failed to parse.
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.
Follow-up to #1991. The search proxy's
queriesarray had no length bound, and zod (before 4.6.6) validates every element of an array before checking its length, which can get very expensive for large request bodies.queriesis now capped at 10 and zod is bumped to 4.6.7, which checks the length first.The bump changed how a
z.undefined()object key is treated (it now has to be present), so theremotecheck usesz.never().optional()instead.More generally, 4.6 requires object keys whose schema accepts
undefined(z.any(),z.unknown(), unions withundefined, ...) to be present unless they're.optional(). The only affected schemas were the RPGF audit log payloads (z.any()), which are now.optional()so entries without a payload keep parsing.