mail-parser: Path Traversal vulnerability in attachment extraction
A path traversal vulnerability was identified in mail-parser when extracting email attachments using the write_attachments() and write_sample() APIs.
A specially crafted email containing malicious attachment filenames (for example, using directory traversal sequences such as "../" or absolute filesystem paths) could cause files to be written outside the intended output directory. Depending on how the library was used and the permissions of the executing process, this could result in arbitrary file overwrite.
The vulnerability affects mail-parser versions 3.8.0 through 4.5.0.
The issue has been addressed by introducing comprehensive filename sanitization and path validation before any file is written to disk. The fix includes:
- Sanitization of attachment filenames before writing.
- Validation that all output paths remain within the intended destination directory.
- Rejection of symbolic link targets.
- Normalization of Windows and POSIX path separators.
- Validation and rejection of invalid or unsafe filenames.
- Protection applied consistently in both write_attachments() and write_sample() APIs.
Users are strongly encouraged to upgrade to the patched release.
Credits
The vulnerability was responsibly reported by Niranjan Ganesan (Security Insights, https://securityinsights.io/, GitHub: @iam-niranjan).
The vulnerability was analyzed, remediated, and the security fix was implemented by Fedele Mantuano, maintainer of mail-parser (LinkedIn: https://www.linkedin.com/in/fmantuano/).
mail-parser would like to thank Niranjan Ganesan for following a coordinated vulnerability disclosure process and for collaborating throughout the remediation and verification of the fix.
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Python (PyPI) | mail-parser | >= 3.8.0, < 4.6.0 | 4.6.0 |
Referencias
- https://github.com/SpamScope/mail-parser/security/advisories/GHSA-fr3h-cpq2-9496
- https://nvd.nist.gov/vuln/detail/CVE-2026-129296
- https://github.com/SpamScope/mail-parser/pull/165
- https://github.com/SpamScope/mail-parser/commit/3d6cb7a51f2ad7ea57e529121dbd5d56f29fefe8
- https://github.com/SpamScope/mail-parser/commit/b0a2e968815f3ed9e129efb0f5f7e935a9dacd1d
- https://github.com/SpamScope/mail-parser
- https://github.com/SpamScope/mail-parser/releases/tag/4.6.0
- Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N- Debilidad (CWE)
CWE-22, CWE-73- Plataforma
- Python (PyPI)
- Paquete
mail-parser- Publicada
- 16.11.2026
- Actualizado
- 17.11.2026 00:17
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-fr3h-cpq2-9496 - CC BY 4.0
Historial de vulnerabilidades: mail-parser
Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 6
- Primera → última
- 11.2026 11.2026
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Alta 2
- Media 4
Divulgaciones por año
- 2026: 6
-
mail-parser: Path Traversal vulnerability in attachment extraction esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.