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.
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:74src/CodeIndex/Cli/SuggestionStore.cs:445src/CodeIndex/Cli/SuggestionStore.cs:457src/CodeIndex/Cli/SuggestionStore.cs:700A 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.