Summary
cdidx import extracts codeindex.db from a zip archive without checking compressed or uncompressed size. A crafted archive can force excessive disk writes before SQLite validation runs.
Evidence
src/CodeIndex/Cli/ExportImportCommandRunner.cs:79 obtains the codeindex.db entry.
src/CodeIndex/Cli/ExportImportCommandRunner.cs:83 calls dbEntry.ExtractToFile(tempPath, overwrite: true) with no entry length or copy limit check.
- Validation with
DbContext.TryValidateExistingCodeIndexDb happens only after the extraction completes.
Expected
Import should enforce a maximum uncompressed database size and fail before or during extraction when the archive exceeds that bound.
Summary
cdidx importextractscodeindex.dbfrom a zip archive without checking compressed or uncompressed size. A crafted archive can force excessive disk writes before SQLite validation runs.Evidence
src/CodeIndex/Cli/ExportImportCommandRunner.cs:79obtains thecodeindex.dbentry.src/CodeIndex/Cli/ExportImportCommandRunner.cs:83callsdbEntry.ExtractToFile(tempPath, overwrite: true)with no entry length or copy limit check.DbContext.TryValidateExistingCodeIndexDbhappens only after the extraction completes.Expected
Import should enforce a maximum uncompressed database size and fail before or during extraction when the archive exceeds that bound.