mail-parser versions 3.8.0 through 4.5.0 contain a path traversal vulnerability in the write_attachments() and write_sample() APIs. Maliciously crafted email attachments with filenames containing directory traversal sequences or absolute paths could cause files to be written outside the intended directory, potentially leading to arbitrary file overwrite. The issue is fixed in version 4.6.0 by sanitizing filenames, validating output paths, rejecting symbolic links, and normalizing path separators.