🇰🇷 한글 설명
Mailpit의 HTML Check API에서 발생한 SSRF(서버 측 요청 위조) 취약점의 수정이 불완전하여, 1.30.0 이전 버전에서는 내부망(루프백, 사설 IP, 링크 로컬 등) 주소로 요청을 보낼 수 있습니다. 공격자는 HTML 이메일을 보내고 HTML Check API를 호출하거나, 공개 사이트의 리다이렉트를 이용해 내부 네트워크에 접근할 수 있습니다.
💡 쉬운 설명
이메일 테스트 도구인 Mailpit이 외부 CSS 파일을 가져오는 과정에서 내부망 주소에도 접근할 수 있는 문제가 있습니다. 이를 악용하면 외부 공격자가 서버를 경유해 내부 시스템을 탐색할 수 있습니다.
🇺🇸 원문 (English)
Mailpit is an email testing tool and API for developers. The fix for GHSA-6jxm-fv7w-rw5j (CVE-2026-23845, "Server-Side Request Forgery (SSRF) via HTML Check API"), shipped in mailpit `v1.28.3`, hardened `internal/htmlcheck/css.go::downloadCSSToBytes` with a 5MB size cap, a `text/css` content-type check, login-info stripping in `isValidURL`, and an opt-in `--block-remote-css-and-fonts` config flag — but did not add the IP-filtering dialer that the same codebase already uses on the two sister SSRF endpoints (the proxy handler and link-check). Prior to version 1.30.0, `internal/htmlcheck/css.go::newSafeHTTPClient` is mis-named — it builds an `http.Client` whose `Transport.DialContext` calls `net.Dialer.DialContext` directly with no IP allowlisting. As a result, the SSRF originally reported by Bao Anh Phan still permits the server to dial loopback, private, link-local, and any other reserved/multicast range, provided the target replies with `HTTP/200` and a content-type beginning with `text/css`. With redirect-following (`CheckRedirect` allows redirects to any `isValidURL` URL with no IP filter), an attacker-controlled public site can redirect mailpit's request into the private network without ever appearing in the email's HTML. In the default mailpit deploy (no UI auth, no SMTP auth, port 1025/8025 exposed), this is an unauthenticated, network-reachable SSRF triggered by sending an HTML email and then issuing one HTTP `GET` to `/api/v1/message/{id}/html-check`. Version 1.30.0 contains an updated fix.
📍 영향받는 시스템
Mailpit 1.30.0 미만 버전 (기본 설정으로 UI/SMTP 인증 없이 배포된 환경)
⚔️ 공격 벡터
HTML 이메일 전송 후 /api/v1/message/{id}/html-check에 GET 요청을 보내 내부 IP로의 SSRF를 유발하거나, 공개 사이트의 리다이렉트를 이용
🛡️ 대응 방법
Mailpit을 1.30.0 이상으로 업데이트하고, 필요 시 --block-remote-css-and-fonts 옵션을 활성화하며, 외부 접근을 방화벽으로 제한
🔧 검증 코드
출력된 버전이 1.30.0 미만이면 취약하며, 1.30.0 이상이면 수정 버전입니다.
mailpit version 2>/dev/null || mailpit --version 2>/dev/null