Gateway: tighten WS connect schema bounds and validation#23420
Closed
bmendonca3 wants to merge 1 commit into
Closed
Gateway: tighten WS connect schema bounds and validation#23420bmendonca3 wants to merge 1 commit into
bmendonca3 wants to merge 1 commit into
Conversation
Member
|
you have been detected be spamming with unwarranted prs and issues and your issues and prs have been automatically closed. |
This was referenced Jun 22, 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.
Summary
Describe the problem and fix in 2–5 bullets:
connectpayload strings/collections had minimal bounds, allowing very large metadata in handshake frames.connectmetadata (max lengths, max items/properties) while preserving existing required fields and behavior.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Oversized handshake metadata and overlong request IDs/method names are now rejected during schema validation with the existing invalid-connect/invalid-request error path.
Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
connectwith oversized client metadata or overlong request frame id.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Compatibility / Migration
Mostly)No)No)Failure Recovery (if this breaks)
src/gateway/protocol/schema/frames.ts.Risks and Mitigations
Greptile Summary
Tightens WebSocket
connectframe validation by adding maximum length constraints to prevent oversized metadata in handshake frames. This reduces parser ambiguity and memory pressure before authentication logic executes.maxItemsconstraints to arrays (256 items max) andmaxPropertiesto permissions (256 max)additionalProperties: falseConfidence Score: 5/5
Last reviewed commit: b4b1bef