You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(security): panic recovery, O_NOFOLLOW hardening, 60 new security/edge tests
Recoverability: added panic recovery to all parallel goroutines and
file-processing helper functions (countFile, searchPattern, hashFile,
readPreview, countWords) so a panic in any goroutine is caught and
returned as an error entry — can never hang the semaphore drain.
O_NOFOLLOW hardening: fixed diff tool (3 os.ReadFile calls), tr tool
(1 call), and base64 tool (1 call) to use readFileNoFollow() which
opens with O_NOFOLLOW. Previously these followed symlinks.
New helper: safeCall() for wrapping tool Call methods with recover.
New helper: readFileNoFollow() for O_NOFOLLOW-compliant file reads.
Tests: 60 new test cases covering:
- Symlink rejection (batch_patch, head_tail)
- Empty file handling (sort, head_tail, word_count)
- Binary file handling (count_lines)
- Max limit enforcement (batch_patch 10, multi_grep 10, http_batch 10)
- Missing required field rejection (all 15 tools)
- Invalid JSON rejection (all 15 tools — 15 subtests)
- Edge cases: division by zero, chain transforms, case-insensitive
sort, multi-file sort, depth-limited tree, invalid checksum algo,
missing JSON key, invalid base64, denied HTTP batch
0 commit comments