matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: No rate limiting on remote image fetching

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug view/html.go fetches remote images from emails without rate limiting. Malicious email with thousands of image URLs could trigger DoS by overwhelming network/memory.

To reproduce Email with 1000 remote images would trigger 1000 HTTP requests.

view/html.go has maxImageSize limit but no rate/count limit.

Expected behavior Limit number of remote images fetched per email (e.g., max 50).

Additional context

  • Good first issue
  • DoS vector: malicious emails with many images
  • LRU cache exists but doesn't prevent initial fetch
  • Related to resource exhaustion

Suggested fix:

const maxRemoteImagesPerEmail = 50

// Track count and skip after limit
if imageCount >= maxRemoteImagesPerEmail {
    // Skip or show placeholder
}

OS All platforms

andrinoff avatar Apr 21 '26 09:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 22 '26 06:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar Jun 04 '26 19:06 floatpanebot