T05 · Unauthorized Access and Privilege Escalation
- Location
lib/reindex.sh:145- Finding
Crafted reindex plans can index files outside the configured drive
- Content
View full analysis
- Remediation
View remediation
&2 return 1 } case "$candidate" in "$drive_root"/*) ;; *) echo "Reindex path escapes drive root: $path" >&2 return 1 ;; esac ``` 3. Require the normalized relative path stored in the index to equal the path relative to the canonical drive root. 4. Reject symlink targets outside the drive. If symlinks are unnecessary, reject symlinks entirely. 5. Apply equivalent containment validation during retrieval rather than trusting paths already present in `INDEX.jsonl`. 6. Validate existing index entries before copying or sending files. 7. Add tests for absolute paths, `../` traversal, nested traversal, symlinks, and malformed reindex plans. ]]>
