Skip to content

SuggestionStore JSON reads should cap depth and record counts #3062

Description

@Widthdom

Problem

SuggestionStore has a file-size cap, but the JSON read options do not define an explicit max depth and the load paths do not cap the number of records accepted from the store.

Evidence:

  • src/CodeIndex/Cli/SuggestionStore.cs:74
  • src/CodeIndex/Cli/SuggestionStore.cs:445
  • src/CodeIndex/Cli/SuggestionStore.cs:457
  • src/CodeIndex/Cli/SuggestionStore.cs:700

A malformed or bloated local suggestion store can force unnecessary parser work and allocate a large in-memory record set within the byte budget.

Suggested fix

Set a conservative JsonSerializerOptions.MaxDepth, enforce a maximum record count in both full and filtered read paths, and preserve the corrupt/oversized store behavior when limits are exceeded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecurity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions