Repository navigation
[2026.10.9] fix(imap): backport nodemailer sender parsing fixes to 2026.10.9 - #187302
Conversation
Passive macOS Gateway stops now preserve an absent current-profile service definition without invoking uninstall, while explicit low-level ghost recovery remains available. Release adaptation: the 2026.10.8 backport of #180390 removed the absent-plist guard from GatewayLaunchAgentManager's disable path without main's follow-up, so every passive stop with no LaunchAgent plist ran `openclaw gateway uninstall` (mac validation: GatewayProcessManagerTests "pause preserves unretainable services" [absent]). Stable has no migration-pending custody or `.authority` wrapper, so the guard checks `custody.definition.plist` directly. Mac-only post-tag fix; npm, Docker and Linux bytes are unaffected. (cherry picked from commit cb10ec4)
Locally adapt the mailauth/mailparser scoped package selectors; not an upstream OpenClaw cherry-pick. Add real sender identity and token-gate regressions. Upstream-author: Andris Reinman <[email protected]> Upstream-commits: 0a8761762ac78f2db2ba37f712f2a52a404ce011, 1cd57d2b8c49dff048c21cdbafdb54439a7f07e2, ee35f5745658bf46952651fa53207255e9dc3406 Upstream-package-gitHead: 2a7e95294d2a4995a19e9009379daf650cdc80e6 Co-authored-by: RomneyDa <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs real behavior proof before merge. What this changesThis PR updates Nodemailer beneath both inbound mail consumers to preserve sender identity and adds parsing and admission regressions. Example: Mail uses From: Attacker (x(y) <[email protected]>) <[email protected]> and To: [email protected].
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this useful, maintainer-authored stable-line security backport open; source review found no definite introduced defect. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe IMAP watcher parses mailbox messages with Mailparser, checks sender identity and authentication, and dispatches accepted messages to an isolated hook agent. flowchart LR
A[IMAP message] --> B[Mailparser and Nodemailer]
B --> C[Sender allowlist]
C --> D[Token or Mailauth verification]
D --> E[Hook dispatch]
C --> F[Recorded rejection]
D --> F
Technical reviewBest possible solution: Keep sender parsing in Nodemailer and preserve the existing IMAP admission policy through the scoped dependency update. Do we have a high-confidence way to reproduce the issue? The upstream tokenizer repair and existing token-admission path support the reported nested-comment bypass; the author reports failing baseline runs, but this read-only review executed no reproduction. Is this the best way to solve the issue? Updating the shared parser beneath both inbound consumers fixes identity at its producer without adding another admission policy or weakening grouped-From rejection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 54818f9e6756. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: Upstream provenance and package integrity check out, while final-effect sender authorization needs evidence. EvidenceWhat I checked:
PR surfaceTests +23, Config +1, Other +56. Total +80 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 29, 2026, 12:40 AM ET / 04:40 UTC. |
Exercise the real TCP IMAP connection, parser, watcher and admission boundary with legitimate and nested-comment spoofed senders sharing a recipient token. Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Summary
Security boundary and proof
IMAP watcher calls mailparser.simpleParser(message.source) before evaluateImapSender. The baseline nested-comment fixture parses the attacker mailbox as [email protected] and the real sender gate incorrectly accepts it using the recipient token. Fixed parsing rejects it before authentication. Quoted-angle and quoted-group fixtures additionally verify that both mailparser- and mailauth-resolved address parsers retain the actual sender identity; real mailauth.authenticate sees the attacker headerFrom.
The grouped From fixture remains rejected as invalid-from: a group has no top-level mailbox. Only the parser identity assertion flattens group members. Neither production admission nor the test expectation permits a grouped From. The quoted-angle fixture is parser identity coverage, not a claimed baseline gate bypass.
Upstream provenance
Nodemailer 10.1.4 registry gitHead: 2a7e95294d2a4995a19e9009379daf650cdc80e6. Source author Andris Reinman [email protected]; original patch headers also retain upstream co-authorship. Relevant later advisory fixes:
Earlier included repairs a502247555fd81773eac337486781f3b6008e16a (angle comments) and b5a896fcb02df1628329d7cd665ca08490b14b56 (SMTP AUTH regex) are already fixed in these train baselines, not newly claimed inbound exploits.
Upstream patches: nodemailer/nodemailer@0a87617 and nodemailer/nodemailer@1cd57d2 . Registry integrity is verified against the lock. Original source/proof trees and #186177 are untouched.
Validation
Status / remaining gates
DRAFT ONLY. Scoped local precommit review is not canonical independent full-context review. That review and hosted checks remain required before ready-for-review or landing. No merge, release, tag, force-push, or gate changes authorized/performed. This PR is intentionally four files; other active-train/security work remains separately owned.