Repository navigation
Bound local mode config before Zod validation - #174
Merged
Merged
Conversation
w4ffl35
marked this pull request as ready for review
October 23, 2026 19:36
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
Bound local custom-mode configuration before YAML and Zod validation. The loader streams at most 1 MB, then checks limits of 100 custom modes, 100 group entries per mode, and 32
allowedMcpServersentries per mode before schema parsing. These bounds cover local project and global mode files only; they do not update Zod or address the separate MCP StreamableHTTP ingestion path.Verification
bash scripts/e2e/run.shpassed 9/9.Security impact
This limits the size and collection counts reaching Zod when HeadlessCode reads local mode files. It is a bounded-input mitigation for this parse path, not a claim that GHSA-mrhx-c7xc-m3w5 is fully resolved. The separate MCP StreamableHTTP path remains outside this change.
Test plan
Review
src/engine/__tests__/mode-config-bounds.test.tsand run the focused mode tests,npm run typecheck,npm run check-standards,npm run check-architecture,npm test, andbash scripts/e2e/run.sh.