Sanitize image evidence at the server upload boundary #984

Merged
timmy merged 1 commits from timmy/983-server-image-sanitization into main 2026-08-16 19:38:35 +00:00
Owner

Closes #983

What changed

  • decode PNG, JPEG, and WebP evidence server-side before every upload path
  • reject MIME mismatches, animation, malformed images, and images over 12 megapixels
  • apply EXIF orientation and re-encode metadata-free pixels under the 2 MiB boundary
  • move decoding off the event loop and replace signature-only fixtures with real images

Verification

  • python3 -m pytest tests/test_image_sanitizer.py tests/test_issue_attachments.py tests/test_update_reply_attachments.py tests/test_global_search.py -q — 52 passed
  • python3 -m pytest tests/ -q — 1860 passed, 3 skipped
Closes #983 ## What changed - decode PNG, JPEG, and WebP evidence server-side before every upload path - reject MIME mismatches, animation, malformed images, and images over 12 megapixels - apply EXIF orientation and re-encode metadata-free pixels under the 2 MiB boundary - move decoding off the event loop and replace signature-only fixtures with real images ## Verification - `python3 -m pytest tests/test_image_sanitizer.py tests/test_issue_attachments.py tests/test_update_reply_attachments.py tests/test_global_search.py -q` — 52 passed - `python3 -m pytest tests/ -q` — 1860 passed, 3 skipped
timmy added 1 commit 2026-08-16 19:34:21 +00:00
security: sanitize image evidence server-side (Closes #983)
All checks were successful
CI / lint (pull_request) Successful in 2m11s
CI / build-release (pull_request) Successful in 5s
CI / browser-journey (pull_request) Successful in 1m11s
CI / release-candidate (pull_request) Has been skipped
966028e0a6
timmy merged commit 48ec66cc30 into main 2026-08-16 19:38:35 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#984
No description provided.