mail-parser is vulnerable to Path Traversal
65
Medium Risk
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.
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.
mail-parser is vulnerable to Path Traversal in versions 3.8.0 - 4.5.0.
Upgrade the mail-parser library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant