Skip to content

Fix LSP message bounds and position reads - #2928

Merged
Widthdom merged 4 commits into
mainfrom
fix-issue2825-2826
Jun 2, 2026
Merged

Fix LSP message bounds and position reads#2928
Widthdom merged 4 commits into
mainfrom
fix-issue2825-2826

Conversation

@Widthdom

@Widthdom Widthdom commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bound LSP frame and header-line parsing before payload buffer allocation.
  • Restrict LSP position-based requests to indexed project files, reject outside/unindexed/oversized documents, and preserve workspace path casing semantics.

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~LspServerTests" -p:UseSharedCompilation=false
  • dotnet build CodeIndex.sln -p:UseSharedCompilation=false
  • dotnet run --project tools/CodeIndex.Changelog/CodeIndex.Changelog.csproj -- check
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • git diff --check origin/main..HEAD
  • Codex adversarial review: No blocking/actionable issues found.

Attempted dotnet test CodeIndex.sln -p:UseSharedCompilation=false; it was manually stopped after roughly 30 minutes without a final summary. Focused LSP tests and solution build passed.

Changelog

  • changelog.d/unreleased/2825.fixed.md
  • changelog.d/unreleased/2826.fixed.md

Follow-ups

None.

Fixes #2825
Fixes #2826

@Widthdom
Widthdom marked this pull request as ready for review June 2, 2026 06:15
@Widthdom
Widthdom merged commit 026142c into main Jun 2, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue2825-2826 branch June 2, 2026 06:16
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.

LSP position requests read arbitrary local files without size or index checks Bound LSP Content-Length and header line sizes

1 participant