Repository navigation
fix(deps): backport zod's leading collection size check so oversized bodies stop validating every element - #9388
Merged
Merged
Conversation
…bodies stop validating every element
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Contributor
[Medium impact] The PR appears safe to merge, with no new actionable findings. SummaryBackports early collection-size checks to Zod 4.3.6 without upgrading Zod.
No new actionable findings were established. Tests were not run during this review.
|
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
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.
Summary
.max()/.length()(and a set's or map's.max()/.size()) only after parsing every element (GHSA-mrhx-c7xc-m3w5). Against a bounded schema, a sub-megabyte body of malformed elements builds one issue per element; the public deployed-chat endpoint validates before auth, so this was an unauthenticated memory blowup (on 1M entries 4.3.6 crashes building the error message)patches/zod@4.3.6.patch, on the ESM and CJS builds: a container larger than its leading upper bound skips its elements, and its own size check reports the singletoo_bigissueunknown/anyobject keys, requires seconds in ISO datetimes, and emits root$refJSON Schema for id'd schemas.@trigger.dev/core, which the root override puts on our zod, declares unknown/any run and IPC fields. The Sim-side fixes for 4.6 are kept onfix/zod-4-6-7(fix(deps): update zod to 4.6.7 so bounded collections stop walking every element before their size check #9386, closed) for when Trigger.dev supports zod 4patches/README.mddocuments the patch and when to remove itType of Change
Testing
too_bigissues without the per-element ones. Async parse matchesRangeError: Invalid string lengthchats.test.tscase: oversizedfilesarray yields onetoo_bigissue. Red on unpatched zod (40,001 issues), green patchedbun run teston lib/api/contracts, lib/api/mcp, lib/permission-groups, lib/dashboards, lib/table (143 files, 1547 tests) and realtime-protocolChecklist
test-auditauthoring gate)