Skip to content

fix(lsp): bound headers and reject ambiguous framing - #219

Open
metaphorics wants to merge 2 commits into
mainfrom
stabilize/lsp-framing
Open

metaphorics wants to merge 2 commits into
mainfrom
stabilize/lsp-framing

Conversation

@metaphorics

Copy link
Copy Markdown
Collaborator

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.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 4e0289bc-f9ce-4990-9bfd-18b93f03b134

📥 Commits

Reviewing files that changed from the base of the PR and between 1701e70 and 787d663.

📒 Files selected for processing (2)
  • crates/bamts-cli/src/lsp.rs
  • crates/bamts-cli/tests/cli.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-20T08:01:55.831941Z 787d663 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/bamts-cli/src/lsp.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant