Skip to content
Merged
42 changes: 37 additions & 5 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1970,9 +1970,25 @@ server over stdio. It reuses the existing CodeIndex database and exposes
`initialize`, `workspace/symbol`, `textDocument/documentSymbol`,
`textDocument/definition`, and `textDocument/references` for editors that can
launch an arbitrary LSP command but do not speak MCP.
Incoming `textDocument.uri` values are rejected before URI parsing when they
exceed 4096 characters, matching the MCP resource URI limit and keeping error
responses bounded.
Incoming `textDocument.uri` values must be strings, must be absolute `file:`
URIs, and are rejected before URI parsing when they exceed 4096 characters,
matching the MCP resource URI limit and keeping error responses bounded. LSP
frame parsing also rejects more than 64 header lines, more than 65536 aggregate
header bytes, any one header line above 8192 bytes, duplicate `Content-Length`
headers, or a body above 8388608 bytes before reading the message body.
Unknown-method diagnostics echo at most 240 method-name characters with `...`
when the method name is longer. Request IDs must be bounded JSON-RPC scalar
values: strings are capped at 256
characters, integer IDs must fit in `Int64`, and non-scalar IDs are rejected as
invalid requests before response IDs are cloned. `workspace/symbol` query
strings are capped at 1000 characters before symbol search runs.
`textDocument/documentSymbol` returns at most 1000 indexed symbols, truncates
each `detail` string to 512 characters with `...`, and stops adding symbols
before the result array exceeds 524288 JSON bytes.
Position-based `definition` and `references` lookups read at most 16384
characters from the target source line before returning an empty result.
When exact indexed path resolution misses, LSP document path fallback inspects
at most 32 basename candidates before treating the document as unresolved.

Tool results include structured JSON in `structuredContent` plus a short text summary in `content`, so AI tools can parse typed data without scraping large text blocks.

Expand Down Expand Up @@ -4237,8 +4253,24 @@ cdidxには**MCP(Model Context Protocol)サーバー**が組み込まれて
任意の LSP command を起動できるが MCP には対応していない editor 向けに
`initialize`、`workspace/symbol`、`textDocument/documentSymbol`、
`textDocument/definition`、`textDocument/references` を公開します。
受信した `textDocument.uri` は 4096 文字を超える場合、URI parse の前に拒否されます。
これは MCP resource URI の上限と揃えており、エラー応答が過大にならないようにします。
受信した `textDocument.uri` は string かつ absolute `file:` URI である必要があり、
4096 文字を超える場合は URI parse の前に拒否されます。これは MCP resource URI の上限と
揃えており、エラー応答が過大にならないようにします。
LSP frame parsing は、message body を読む前に 64 行を超える header、合計 65536 bytes を
超える header、8192 bytes を超える単一 header 行、重複した `Content-Length` header、
8388608 bytes を超える body を拒否します。
method-not-found diagnostic で echo する method name は最大 240 文字に制限され、
長い場合は `...` を付けて切り詰めます。
request ID は bounded な JSON-RPC scalar value に限定され、string は 256 文字まで、
integer ID は `Int64` に収まるものだけを受理し、non-scalar ID は response ID を複製する前に
invalid request として拒否します。
`workspace/symbol` の query string は symbol search を実行する前に 1000 文字で上限をかけます。
`textDocument/documentSymbol` は最大 1000 件の indexed symbol を返し、各 `detail` string を
`...` 付きの 512 文字に切り詰め、result array が 524288 JSON bytes を超える前に symbol 追加を止めます。
position-based な `definition` / `references` lookup は、対象 source line を最大 16384 文字まで読み、
超過時は空の result を返します。
exact indexed path resolution が失敗した場合、LSP document path fallback は最大 32 件の
basename candidate だけを確認し、見つからなければ unresolved document として扱います。

ツール結果は `structuredContent` に構造化JSON、`content` に短い要約テキストを返すため、AIツールは巨大なテキストをパースせずに型付きデータを扱えます。

Expand Down
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3128.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: security
issues:
- 3128
affected:
- src/CodeIndex/Lsp/LspServer.cs
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP `workspace/symbol` queries now enforce the shared query length limit (#3128)** — oversized symbol queries are rejected before database search work starts.

## 日本語

- **LSP `workspace/symbol` query に共通の query 長上限を適用しました (#3128)** — 過大な symbol query は database search を開始する前に拒否されます。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3130.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: security
issues:
- 3130
affected:
- src/CodeIndex/Lsp/LspServer.cs
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP `documentSymbol` responses now bound detail and response size (#3130)** — symbol details are truncated with an explicit marker and response arrays stop before exceeding the JSON byte budget.

## 日本語

- **LSP `documentSymbol` response の detail と response size に上限を追加しました (#3130)** — symbol detail は明示的な marker 付きで切り詰め、response array は JSON byte 予算を超える前に打ち切ります。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3136.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: security
issues:
- 3136
affected:
- src/CodeIndex/Lsp/LspServer.cs
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP position lookups now cap target line length (#3136)** — definition and references requests stop reading oversized source lines before token extraction and return an empty result.

## 日本語

- **LSP position lookup の対象行長に上限を追加しました (#3136)** — definition / references request は token extraction の前に過大な source line の読み取りを止め、空の result を返します。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3137.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: security
issues:
- 3137
affected:
- src/CodeIndex/Lsp/LspServer.cs
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP document path fallback now caps basename candidates (#3137)** — exact indexed path resolution still wins, while basename fallback stops after a small bounded candidate set.

## 日本語

- **LSP document path fallback の basename candidate 数に上限を追加しました (#3137)** — exact indexed path resolution を優先しつつ、basename fallback は小さな bounded candidate set で打ち切ります。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3203.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: security
issues:
- 3203
affected:
- src/CodeIndex/Lsp/LspServer.cs
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP `textDocument.uri` now has explicit type validation (#3203)** — document handlers reject non-string URI values before URI parsing or path resolution while keeping the JSON-RPC error bounded.

## 日本語

- **LSP `textDocument.uri` の型検証を明示しました (#3203)** — document handler は URI parse や path resolution の前に string 以外の URI 値を拒否し、JSON-RPC error を bounded に保ちます。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3204.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: security
issues:
- 3204
affected:
- src/CodeIndex/Lsp/LspServer.cs
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP request IDs are validated before cloning (#3204)** — request IDs are now limited to bounded JSON-RPC scalar values before the server copies them into responses.

## 日本語

- **LSP request ID を複製前に検証するようになりました (#3204)** — request ID は response へコピーされる前に、bounded な JSON-RPC scalar value に制限されます。
16 changes: 16 additions & 0 deletions changelog.d/unreleased/3205.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
category: security
issues:
- 3205
affected:
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP unknown-method diagnostics keep method names capped (#3205)** — coverage and documentation now explicitly lock the existing 240-character echo limit for method-not-found responses.

## 日本語

- **LSP unknown-method diagnostic の method name echo 上限を明示しました (#3205)** — method-not-found response が既存の 240 文字上限を維持することを test と documentation で固定しました。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3206.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: security
issues:
- 3206
affected:
- src/CodeIndex/Lsp/LspServer.cs
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP document operations reject non-file URIs (#3206)** — document handlers no longer treat `untitled:` or other non-`file:` URI schemes as workspace-relative paths.

## 日本語

- **LSP document 操作が non-file URI を拒否するようになりました (#3206)** — document handler は `untitled:` など `file:` 以外の URI scheme を workspace-relative path として扱わなくなりました。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3229.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: security
issues:
- 3229
affected:
- src/CodeIndex/Lsp/LspServer.cs
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP frame parsing rejects duplicate `Content-Length` headers (#3229)** — duplicate length headers are no longer accepted even when they repeat the same value.

## 日本語

- **LSP frame parsing が重複した `Content-Length` header を拒否するようになりました (#3229)** — 同じ値の繰り返しであっても、length header の重複は受理されません。
17 changes: 17 additions & 0 deletions changelog.d/unreleased/3230.security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
category: security
issues:
- 3230
affected:
- src/CodeIndex/Lsp/LspServer.cs
- tests/CodeIndex.Tests/LspServerTests.cs
- USER_GUIDE.md
---

## English

- **LSP frame headers now have count and aggregate byte limits (#3230)** — the LSP parser rejects excessive header lines or aggregate header bytes before reading the message body.

## 日本語

- **LSP frame header に行数と合計 byte 数の上限を追加しました (#3230)** — LSP parser は message body を読む前に過大な header 行数または合計 header byte 数を拒否します。
Loading
Loading