GHSA-FR3H-CPQ2-9496

Vulnerability from github – Published: 2026-11-16 22:10 – Updated: 2026-11-16 22:10
VLAI
Summary
mail-parser: Path Traversal vulnerability in attachment extraction
Details

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.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "mail-parser"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.8.0"
            },
            {
              "fixed": "4.6.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-129296"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-73"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-16T22:10:55Z",
    "nvd_published_at": "2026-11-16T18:17:30Z",
    "severity": "MODERATE"
  },
  "details": "A path traversal vulnerability was identified in mail-parser when extracting email attachments using the write_attachments() and write_sample() APIs.\n\nA 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.\n\nThe vulnerability affects mail-parser versions 3.8.0 through 4.5.0.\n\nThe issue has been addressed by introducing comprehensive filename sanitization and path validation before any file is written to disk. The fix includes:\n\n- Sanitization of attachment filenames before writing.\n- Validation that all output paths remain within the intended destination directory.\n- Rejection of symbolic link targets.\n- Normalization of Windows and POSIX path separators.\n- Validation and rejection of invalid or unsafe filenames.\n- Protection applied consistently in both write_attachments() and write_sample() APIs.\n\nUsers are strongly encouraged to upgrade to the patched release.\n\n## Credits\n\nThe vulnerability was responsibly reported by **Niranjan Ganesan** (Security Insights, https://securityinsights.io/, GitHub: @iam-niranjan).\n\nThe vulnerability was analyzed, remediated, and the security fix was implemented by **Fedele Mantuano**, maintainer of mail-parser (LinkedIn: https://www.linkedin.com/in/fmantuano/).\n\nmail-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.",
  "id": "GHSA-fr3h-cpq2-9496",
  "modified": "2026-11-16T22:10:55Z",
  "published": "2026-11-16T22:10:55Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/SpamScope/mail-parser/security/advisories/GHSA-fr3h-cpq2-9496"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-129296"
    },
    {
      "type": "WEB",
      "url": "https://github.com/SpamScope/mail-parser/pull/165"
    },
    {
      "type": "WEB",
      "url": "https://github.com/SpamScope/mail-parser/commit/3d6cb7a51f2ad7ea57e529121dbd5d56f29fefe8"
    },
    {
      "type": "WEB",
      "url": "https://github.com/SpamScope/mail-parser/commit/b0a2e968815f3ed9e129efb0f5f7e935a9dacd1d"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/SpamScope/mail-parser"
    },
    {
      "type": "WEB",
      "url": "https://github.com/SpamScope/mail-parser/releases/tag/4.6.0"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "mail-parser: Path Traversal vulnerability in attachment extraction"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…