8000 Limit decoded image size during ingest by jasonmadigan · Pull Request #180 · tracefinity/tracefinity · GitHub
[go: up one dir, main page]

Skip to content

Limit decoded image size during ingest - #180

Merged
jasonmadigan merged 1 commit into
mainfrom
fix/178-image-pixel-limit
Aug 11, 2026
Merged

jasonmadigan merged 1 commit into
mainfrom
fix/178-image-pixel-limit

Conversation

@jasonmadigan
Copy link
Copy Markdown
Collaborator

Summary

  • Reject photos and masks above a configurable decoded-pixel limit before pixel data is materialized, preventing small compressed images from consuming hundreds of megabytes.
  • Return HTTP 413 for oversized images and document the 64-megapixel default for self-hosted operators.

Test evidence

  • cd backend && venv/bin/pytest -q — 312 passed.
  • make lint — passed; frontend reported 9 existing warnings and no errors.
  • A 420 KB, 144-megapixel PNG proof case was rejected before decode with about 26 MB maximum RSS, down from about 720 MB before the fix.

Closes #178

@jasonmadigan
jasonmadigan marked this pull request as ready for review August 11, 2026 14:25
@jasonmadigan
jasonmadigan merged commit bb3f0f8 into main Aug 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image.open() without MAX_IMAGE_PIXELS allows decompression-bomb DoS

1 participant

0