picoclaw/pkg/tools/fs
admin-mf cd1720f40b forward-port: write size cap + crypto/rand temp suffixes in fs sandbox
Re-applies two hardening changes from the deleted pkg/tools/filesystem.go
to upstream's pkg/tools/fs/filesystem.go (sandboxFs.WriteFile):

1. Reject writes larger than MaxWriteFileSize (20 MB) before opening any
   file. Prevents runaway writes from a misbehaving caller filling disk.
2. Replace time.Now().UnixNano() temp suffixes with crypto/rand-generated
   hex. Eliminates predictable temp paths under concurrent or hostile
   filesystem scenarios; the prior nanosecond stamp could collide on
   high-resolution clocks across goroutines.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 12:16:13 -05:00
..
edit.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
edit_test.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
filesystem.go forward-port: write size cap + crypto/rand temp suffixes in fs sandbox 2026-05-07 12:16:13 -05:00
filesystem_test.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
load_image.go fix(feishu): fix image download with API fallback and post image support (#2708) 2026-04-30 11:08:00 +08:00
load_image_test.go fix(feishu): fix image download with API fallback and post image support (#2708) 2026-04-30 11:08:00 +08:00
send_file.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
send_file_test.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
shared.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00