Executive brief
Mailpit's image thumbnail feature can be exploited by sending specially crafted email attachments that appear small when compressed but expand to hundreds of megabytes when decoded. An attacker can repeatedly request thumbnail generation through the API or by opening emails in the web UI, causing excessive memory and CPU consumption that leads to denial of service. The issue affects the default unauthenticated API configuration.
Technical details
The vulnerability is a resource-exhaustion flaw in the thumbnail handler (`server/apiv1/thumbnails.go`) that processes image attachments via the `GET /api/v1/message/{id}/part/{partID}/thumb` endpoint. The handler calls `imaging.Decode()` on untrusted attachment content before checking decoded pixel dimensions or memory budget, resulting in unbounded raster allocation. A malicious PNG can declare 4096×4096 dimensions (67 MB decoded) while remaining only 65 KB compressed; the endpoint then allocates and decodes the full image before scaling to the fixed 180×120 output size. The default message-size controls do not prevent this because they limit encoded message bytes, not decoded raster size. The endpoint is reachable by unauthenticated clients on default deployments, and opening image attachments in the web UI automatically triggers the vulnerable path. Patch version 1.30.4 adds dimension and pixel-budget checks before full image decode.
Affected products
- axllent Mailpit <= 1.30.3
Timeline
- 2026-07-09: disclosed
- 2026-09-02: advisory: GHSA-75mr-qw9x-3r39 published
- 2026-09-02: patched: Fixed in version 1.30.4