כותרת Penligent

CVE-2026-129295: mail-parser Fixes and Complete Email Inspection

CVE-2026-129295 is a regular-expression denial-of-service issue in mail-parser’s handling of address and Received headers. The maintainer advisory identifies versions 4.2.0 to before 4.6.1 as affected. Updating only to that first fixed version, however, leaves other documented mail-processing problems unresolved: the cumulative baseline for the six verified CVEs in this article is 4.6.3.

One later issue, CVE-2026-129301, exposes a security problem that a mail pipeline can mistake for a clean result: one unusable attachment could abort write_attachments(), leaving later attachments absent from the extraction directory. A downstream scanner that sees only that directory could miss content still present in the original email. Its advisory identifies versions 4.6.0 through 4.6.2 as affected and 4.6.3 as fixed.

The sequence of fixes covers attachment paths, regular-expression cost, sender attribution, header preservation, and exception handling. Version 4.6.3 was released on August 19, 2026; the November advisory-feed activity should not be described as a new software release.

One package upgrade, six distinct acceptance conditions

The advisories do not all name the same first fixed version. Preserve that distinction when reconciling scanner findings or explaining why a system already on 4.6.2 still requires an update.

CVEגרסאות מושפעותFirst fixBoundary to verify
CVE-2026-1292963.8.0 to before 4.6.04.6.0Attachment writes remain inside the destination directory.
CVE-2026-1292954.2.0 to before 4.6.14.6.1Untrusted address and Received headers do not trigger polynomial regex work.
CVE-2026-129297Through 4.6.14.6.2Sender IP attribution respects trusted-hop position and can return unknown.
CVE-2026-129299Through 4.6.14.6.2Literal headers and body content remain visible; serialization errors do not escape unexpectedly.
CVE-2026-1293003.7.0 to before 4.6.34.6.3An unusable Received date becomes a null date without losing the message.
CVE-2026-1293014.6.0 to before 4.6.34.6.3A per-attachment failure does not discard later attachments; containment failures remain fatal.

The numbers are listed individually because the verified source set is not a continuous CVE sequence. Do not infer another vulnerability, affected range, or fix from an adjacent identifier.

Why fixing the regex is necessary but not the whole upgrade

For CVE-2026-129295, the advisory describes two separate costly paths: fallback address parsing and Received-clause splitting. The 4.6.1 change replaces the address fallback with a bounded scan and normalizes whitespace before clause splitting. A message need not have an obviously malformed overall structure to reach these paths, so ordinary email acceptance checks are not a substitute for the fix.

Bounded parsing time remains one acceptance condition. Versions 4.6.1 and 4.6.2 can satisfy parts of that condition while retaining the later content-loss or batch-extraction failures in the matrix. Treat the security update as a set of behavior changes across the whole worker, not as a single latency check.

The output directory is not the original message

For CVE-2026-129301, the advisory describes unusable filenames, overlong basenames, and decoding failures escaping the attachment loop. The parser itself could succeed while writing failed. This divides the pipeline into two independently observable steps: interpreting the message and materializing the attachments that downstream tools inspect.

ה 4.6.3 patch makes individual unusable attachments log-and-skip cases while preserving a separate MailParserPathError for directory-containment failure. It also moves decoding before file creation, limits filename length, and improves collision handling. These details change the meaning of a successful function return: some attachments may have been skipped even though the rest of the batch was saved.

The original message feeds an extraction manifest and scanner input; skipped attachments remain explicitly accounted for.
Proposed integration record derived from the documented attachment-writing behavior.

Our operational recommendation is to retain three artifacts for each message: the original bytes or a durable reference to them, an extraction manifest, and the downstream inspection outcome. The manifest should record how many attachments were observed, which were written, which were skipped, and why. A useful invariant is that every observed attachment has a recorded disposition. An empty directory without that accounting is an unknown result, not evidence that the message had no attachments.

This is an evidence-design recommendation, not an assertion that mail-parser returns a complete manifest automatically. Build the accounting at the integration boundary using the parser output, write results, and logging available in your application. Preserve warnings as security-relevant events instead of suppressing them as routine parser noise.

Do not turn containment failures into ordinary skips

Broad exception handling appears in several advisory workarounds because some exceptions were outside the library’s usual hierarchy. At an outer worker boundary, catching an unexpected exception can prevent a process crash, provided the message is retained and marked unparsed. That is different from swallowing a path-containment failure and continuing to treat the result as successfully inspected.

The 4.6.3 patch intentionally keeps MailParserPathError outside the per-attachment skip handler. Preserve that distinction in wrappers and job queues. A containment failure should produce a failed or quarantined extraction result with the original message retained. It should not be downgraded to an empty or clean scan.

Likewise, the earlier path-traversal fix protects both write_attachments() ו write_sample(). A custom writer that bypasses those APIs does not automatically inherit their filename and containment checks. Review the actual code path used by the worker, including any scanner integration that writes decoded payloads itself.

Header fidelity and sender attribution need different checks

CVE-2026-129299 fixes header names being resolved through Python attribute lookup and normalized before lookup. That could replace or drop the value of a literal header, produce unserializable objects, or lose a body-only message. The advisory also documents a behavior change: header names are preserved as sent, and an absent raw-header accessor returns an empty JSON array.

Review consumers that assume normalized header keys, interpret null ו [] identically, or use has_defects as the sole guarantee of complete extraction. The patch is valuable precisely because earlier content loss could occur without an appropriate defect signal.

For CVE-2026-129297, the maintainer’s correction selects address candidates by position in trusted-hop context rather than their appearance. The method now returns אף אחד in cases where attribution would be unreliable. Keep that unknown state explicit in allowlists, reputation enrichment, and audit records; replacing it with a convenient address reintroduces an unsupported trust decision in application code.

A message record links separate parsing, extraction, and inspection results; incomplete extraction prevents an unqualified clean result.
Proposed status model; no malicious message was executed or production result measured.

A bounded acceptance run for your worker

Use a small, benign fixture corpus in an isolated test worker. The point is to verify pipeline behavior after the update, not to reproduce resource exhaustion on a production queue. Record the exact interpreter environment and installed distribution version from the worker, rather than a developer laptop:

python -c "from importlib.metadata import version; print(version('mail-parser'))"
Benign test caseExpected integration evidence
A normal message with two known attachments.Both parts appear in the manifest and both expected files reach the scanner.
Two harmless attachments with names differing only by case.Distinct content remains available; no silent overwrite is accepted.
A message containing a literal underscore in a header name.The original name and value remain visible to the consuming application.
A body-only message.The body is retained and output types match the documented interface.
A fixture with an absent or unusable attribution value.The consumer preserves unknown instead of inventing a sender IP.
A simulated extraction error at the application boundary.The job records incomplete inspection and retains the original message.

For regression cases tied to invalid dates or filenames, review the upstream tests and run them only in an appropriate local environment with resource limits. No regression test execution or performance result is claimed here. Retain parse timeouts and input-size controls as defense in depth, while recognizing that they do not repair header loss or attribution semantics.

Make incomplete inspection visible

The six fixes share a broader integration lesson: a successful parse, a nonempty output directory, and a clean downstream scanner verdict are separate observations. Each can be true while another step failed. A robust result needs a status for parsing, extraction completeness, and inspection, linked to the same original message.

When using Penligent in an authorized validation workflow, keep the worker version, fixture outcome, and incomplete-inspection handling as separate evidence. The useful security finding is whether the application preserves that boundary, beyond whether its dependency inventory lists a fixed version.

The following official Penligent video is a general product workflow demonstration. It does not reproduce these mail-parser vulnerabilities.

Method: AI-assisted analysis checked against maintainer advisories, the 4.6.2 and 4.6.3 release metadata, and the 4.6.3 patch on November 17, 2026. No malicious email was executed and no performance benchmark was run. The extraction manifest and acceptance matrix are operational recommendations derived from the documented behavior changes.

שתף את הפוסט:
פוסטים קשורים
he_ILHebrew