Commit 9c9f20f
committed
fix: normalize include_paths -- strip backslashes, reject traversal, defense in depth
Sanitizer now matches the validation in IndexConfig.sanitize_paths:
- Backslashes replaced with forward slashes
- Leading/trailing whitespace and slashes stripped
- Path traversal (..) entries rejected
- Non-string and empty entries filtered
2 new tests: traversal rejection, backslash normalization. 35 total pass.
Skipped findings:
- Cache keyed by include_paths: not needed, cache cleared on re-index
- repos.py truthy-only write: already fixed in previous commit
- Test type hints: entire suite has zero, adding to 3 tests is inconsistent1 parent 04ac019 commit 9c9f20f
2 files changed
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
311 | 332 | | |
312 | 333 | | |
313 | 334 | | |
| |||
0 commit comments