Security hardening: treat repository-controlled state as untrusted (.code-index/, .code-index.toml, git config, committed index.db) #380
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#380
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the 2026-10-15 whole-project review. Severity: high. This is pre-existing; no recent change introduced it. Reproduction details are kept off this public tracker on purpose.
Class of problem
code-index treats several inputs that a repository can ship as if the user created them:
.code-index/state directory. It is opened and written without checking that it is a real directory owned by the current user, and state files are written without symlink protection..code-index.toml.[[links]]may point anywhere, including the home directory.read_codeserves files under a root even when they were never indexed.index.db. It is opened with SQLite's default trust settings.The deliberately designed boundaries were reviewed and are sound: RPC auth, package signing and the archive format, the wasm guest, path containment, and SQL parameters.
Direction
Generic rather than per case:
trusted_schema=OFF).read_codeis limited to indexed paths.Also in scope:
install.shshould force https.Released in v0.40.0 (https://git.h-dv.de/h-dv/code-index/releases/tag/v0.40.0, PR #388, merge
a48fb945): repository-declared[[links]]and a raisedmax_file_size_mbare requests granted bycode-index approve; built-in parsing has the per-file deadline;read_codeserves only indexed files; one git command builder neutralises repository-configured programs and skips submodules; installers use https with TLS 1.2+.