fix(lsp): bound headers and reject ambiguous framing - #219
metaphorics wants to merge 2 commits into
Conversation
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
This PR strengthens LSP header validation to prevent resource exhaustion attacks. The implementation adds comprehensive bounds checking and proper error handling for oversized and malformed headers.
Critical Issue Found:
- Integer underflow risk in header byte budget calculation that could bypass security limits
Strengths:
- Comprehensive test coverage for edge cases
- Proper error handling for malformed headers
- Security-focused validation improvements
Please address the integer overflow issue before merging.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
Change
Bound LSP headers to 8 KiB during reading. Reject repeated Content-Length, malformed lines, and truncated headers. Preserve exact-limit and fragmented framing.
Verification
Three new unit regressions failed before the fix. All 43 LSP unit tests now pass. Two real CLI E2E tests pass, covering three hostile header forms and TypeScript type-error recovery across four input chunk sizes. CLI clippy with warnings denied and formatting pass.
Stack
Follows merged #217. Next slice fixes optional-chain continuation execution.
Refs #157. No product or release-completion claim.