CVE-2026-67446: Mailpit: Thumbnail generation decodes unbounded image dimensions before scaling
Mailpit is an email testing tool and API for developers. Prior to 1.30.4, Mailpit decodes attacker-supplied image attachments into a full raster before checking decoded dimensions, pixel count, or memory use in the GET /api/v1/message/{id}/part/{partID}/thumb endpoint. The Thumbnail handler in server/apiv1/thumbnails.go obtains attachment bytes through storage.GetAttachmentPart(), accepts image/ content, and calls imaging.Decode() with AutoOrientation before imaging.Fill() scales the image to 180 by 120 pixels. A compact image declaring very large dimensions can therefore consume disproportionately large memory and CPU, and opening the message UI can trigger the same endpoint through server/ui-src/components/message/MessageAttachments.vue. This can degrade availability when an unauthenticated client can store the crafted attachment and reach the web API. This issue is fixed in version 1.30.4.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Mailpitto a version that resolves this vulnerability.Fixed in 1.30.4
Event History
Frequently Asked Questions
Which deployments are most exposed to availability impact?
Deployments are exposed when an unauthenticated client can both store a crafted image attachment and reach the web API. Opening the message UI can also trigger thumbnail generation for an affected attachment.
What must an attacker provide to trigger the issue?
The attacker needs to supply an attachment accepted as image/* with compact encoded data that declares very large dimensions. Requesting the attachment thumbnail through the message-part thumb API causes Mailpit to decode the full raster before scaling it.
Are default thumbnail dimensions sufficient to prevent resource exhaustion?
No. Although the thumbnail is ultimately scaled to 180 by 120 pixels, the vulnerable behavior occurs earlier, when the supplied image is decoded at its declared dimensions.
How can I determine whether an instance needs remediation?
Instances running a version prior to 1.30.4 are affected. Upgrade to version 1.30.4 to obtain the fix.