Intel

AIKIDO-2026-139198

mail-parser is vulnerable to Path Traversal

Path TraversalGHSA-fr3h-cpq2-9496 Published Aug 11, 2026

65

Medium Risk

This Affects:

PYTHONmail-parser
3.8.0 - 4.5.0
Fixed in 4.6.0
Are you affected? Scan for Free

TL;DR

The attachment-writing helpers in the mail-parser library build output paths by joining a caller-supplied directory with the raw attachment filename taken from email metadata. Because the email sender fully controls that filename, values containing ../ sequences, absolute paths, or names that resolve through a symlink cause attachments to be written outside the intended output directory. This lets a crafted email create or overwrite arbitrary files on the host that runs the parser. The fix strips directory components from filenames, verifies the resolved path stays inside the output directory, rejects symlink destinations, and deduplicates names within an attachment batch.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application persists parsed attachments to disk using the library's attachment-writing helpers (for example write_attachments or the CLI store option) with untrusted email input.

Background info

mail-parser is vulnerable to Path Traversal in versions 3.8.0 - 4.5.0.

How to fix this

Upgrade the mail-parser library to the patch version.