Server-side cap on attachment filenames #248
Notifications
Total Time Spent: 22 minutes
fen
22 minutes
No due date set.
Dependencies
No dependencies set.
Reference: poslop/palette#248
Reference in New Issue
Block a user
Pre-release pentest (v0.4.0 prep) low finding.
A 250-char multipart filename is accepted and stored verbatim, echoed in full in Content-Disposition. Render-side chip truncation contains it in the UI, so impact is storage/DB-field bloat only.
Proposed: reject or truncate filenames over ~128/255 chars server-side in internal/api (attachmentExtName parsing path, internal/api/server.go).
Repro: curl -F "file=@/tmp/$(python3 -c "print(chr(98)*250)+.txt")" POST /api/pastes -> 201.
QA PASS (fix attempt 1, PR #253). Merged to dev, CI docker green, deployed to palette-dev and verified live: multipart create with a 250-char filename returns 201 with a 128-byte stored filename; GET /f/... Content-Disposition echoes only the 128-byte name. Note: truncation is byte-based, so a >128-byte name can lose its extension (e.g. 246 b's + .txt -> 128 b's). Acceptable for this finding.