Skip to content

fix: enforce iMessage outbound allowlist - #88911

Closed
LDMB123 wants to merge 18 commits into
openclaw:mainfrom
LDMB123:codex/upstream-imessage-outbound-allowlist
Closed

LDMB123 wants to merge 18 commits into
openclaw:mainfrom
LDMB123:codex/upstream-imessage-outbound-allowlist

Conversation

@LDMB123

@LDMB123 LDMB123 commented Jun 1, 2026 •

Copy link
Copy Markdown

Summary

  • Enforce iMessage outbound allowlist checks before private API probing or send calls for reply, sendWithEffect, upload-file, and normal send paths.
  • Keep direct-message and group-target policies separate while preserving configured accessGroup expansion.
  • Add blocked-target and allowlisted-target coverage for the affected send paths.

Verification

  • node scripts/run-vitest.mjs extensions/imessage/src/actions.test.ts extensions/imessage/src/send.test.ts
  • pnpm run lint:extensions:bundled
  • git diff --check

Real behavior proof

Behavior addressed: iMessage outbound sends now fail closed before transport/runtime calls when the configured allowlist does not include the handle or group target.

Real environment tested: Local OpenClaw source checkout on macOS at PR head cb227048c2; commands ran against the actual OpenClaw iMessage extension code, with no live iMessage account or private API secrets used.

Exact steps or command run after this patch: node scripts/run-vitest.mjs extensions/imessage/src/actions.test.ts extensions/imessage/src/send.test.ts; pnpm run lint:extensions:bundled; git diff --check.

Evidence after fix: Terminal capture from the local OpenClaw checkout:

$ node scripts/run-vitest.mjs extensions/imessage/src/actions.test.ts extensions/imessage/src/send.test.ts
Test Files  2 passed (2)
Tests  71 passed (71)
[test] passed 1 Vitest shard in 5.21s

$ pnpm run lint:extensions:bundled
$ node scripts/run-bundled-extension-oxlint.mjs
exit status: 0

$ git diff --check
exit status: 0

Observed result after fix: Blocked-target paths reject before runtimeMock.sendRichMessage, runtimeMock.sendAttachment, or client.request are called; allowlisted paths still call client.request with the expected iMessage payload. The bundled-extension lint command exits 0.

What was not tested: A live iMessage private API send was not run from this machine; this PR intentionally avoids live account credentials and validates the fail-closed behavior in the extension runtime.

Fork Context

This is a temporary upstream-review branch. The same accepted fix remains on LDMB123/openclaw fork main, per the fork cleanup plan.

@openclaw-barnacle openclaw-barnacle Bot added channel: imessage Channel integration: imessage size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 1, 2026
@clawsweeper

clawsweeper Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 1, 2026, 4:54 PM ET / 20:54 UTC.

Summary
The branch adds iMessage outbound allowlist enforcement for normal sends and private-API message actions, threads trusted requester-sender context through shared outbound delivery, updates direct/group target classification, and adds regression coverage.

PR surface: Source +496, Tests +1578. Total +2074 across 20 files.

Reproducibility: no. live reproduction was run. Source inspection shows current main has no outbound allowlist gate while docs define iMessage DM/group allowlist policy, so the issue is source-reproducible but the real iMessage path still needs live proof.

Review metrics: 2 noteworthy metrics.

  • Existing iMessage policy surfaces enforced outbound: 2 existing policy families changed. dmPolicy and groupPolicy/groupAllowFrom now affect outbound sends and actions, so existing configurations can change behavior after upgrade.
  • Extension-facing context surface expanded: 2 type surfaces add requesterSenderId. The PR adds requesterSenderId to channel send/outbound contexts, which is additive but still affects plugin/channel API expectations.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted live iMessage/Gateway proof for a blocked target and an allowlisted send/action path.
  • [P1] Get explicit maintainer acceptance of the fail-closed upgrade behavior and any operator/release-note guidance needed.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR supplies terminal output for tests/lint/type checks only and explicitly lacks a live iMessage private API send; add redacted live Gateway/iMessage proof and update the PR body to trigger re-review.

Risk before merge

  • [P1] Existing iMessage users with incomplete or legacy allowFrom/groupAllowFrom/defaultTo configuration may see sends, replies, uploads, reactions, or group actions blocked after upgrade because the PR intentionally applies fail-closed outbound enforcement.
  • [P1] The trusted requester-sender plumbing crosses shared outbound and extension-facing channel contexts; a mistake can either block valid group replies or authorize a reply under the wrong sender boundary.
  • [P1] The supplied proof is mocked/unit and lint/typecheck output only; it does not show blocked and allowlisted iMessage outbound behavior against a real Gateway/iMessage setup.

Maintainer options:

  1. Require live proof before merge (recommended)
    Ask for redacted live iMessage/Gateway terminal output, logs, recording, or linked artifact showing one blocked target and one allowlisted send/action path, plus maintainer acceptance of the fail-closed upgrade behavior.
  2. Accept unit-only proof explicitly
    A maintainer could decide that private iMessage credentials make live contributor proof impractical, but that should be an explicit security and compatibility acceptance before merge.
  3. Pause until a live Mac proof path exists
    If neither contributor nor maintainer can run the real iMessage path, keep this PR open rather than merging a security-boundary change on mock-only evidence.

Next step before merge

  • [P1] Human maintainer review is needed for the live iMessage proof gate and fail-closed compatibility/security-boundary decision; there is no narrow mechanical repair to queue from this review.

Security
Cleared: No concrete new security or supply-chain defect was found in the inspected diff, but the security-boundary change still needs live proof before merge.

Review details

Best possible solution:

Land only after a maintainer accepts the fail-closed upgrade semantics and redacted live iMessage/Gateway proof shows both blocked and allowlisted outbound paths in a real setup.

Do we have a high-confidence way to reproduce the issue?

No live reproduction was run. Source inspection shows current main has no outbound allowlist gate while docs define iMessage DM/group allowlist policy, so the issue is source-reproducible but the real iMessage path still needs live proof.

Is this the best way to solve the issue?

Unclear until live proof and maintainer compatibility acceptance are supplied. The code shape is plausibly the right plugin-boundary fix, with shared core only forwarding trusted context, but the fail-closed behavior is a maintainer decision before merge.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against f8d5f162a129.

Label changes

Label justifications:

  • P1: This is a security-sensitive iMessage channel workflow change that can block or authorize real outbound messages.
  • merge-risk: 🚨 compatibility: The PR intentionally makes existing iMessage allowlist configuration fail closed for outbound paths that current main does not gate.
  • merge-risk: 🚨 message-delivery: Incorrect target classification or requester-sender propagation can suppress valid iMessage replies/actions or partially deliver multi-part replies.
  • merge-risk: 🚨 security-boundary: The diff changes the allowlist boundary for private-API iMessage sends and actions, including trusted sender authorization for group replies.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR supplies terminal output for tests/lint/type checks only and explicitly lacks a live iMessage private API send; add redacted live Gateway/iMessage proof and update the PR body to trigger re-review.
Evidence reviewed

PR surface:

Source +496, Tests +1578. Total +2074 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 12 507 11 +496
Tests 8 1582 4 +1578
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 20 2089 15 +2074

What I checked:

  • Repository policy applied: Root and scoped policies were read; they make plugin/channel APIs, config/default behavior, fallback behavior, and fail-closed changes compatibility-sensitive review surfaces. (AGENTS.md:15, f8d5f162a129)
  • Current main lacks this outbound gate: Current main has no assertIMessageOutboundAllowed symbol under the iMessage or core outbound paths, so the central change is not already implemented on main. (f8d5f162a129)
  • Merge result enforces normal-send policy: The merge result calls assertIMessageOutboundAllowed before resolving service/send behavior in sendMessageIMessage. (extensions/imessage/src/send.ts:856, 207f80c8b1b2)
  • Merge result adds DM and group allowlist policy: The new helper enforces disabled and allowlist handling for group targets and DM targets, including trusted requester-sender handling for group replies. (extensions/imessage/src/outbound-allowlist.ts:188, 207f80c8b1b2)
  • Merge result gates private-API actions: The action handler resolves an outbound action target and calls the allowlist assertion before the private API action branches proceed. (extensions/imessage/src/actions.ts:557, 520d11a8d567)
  • Existing iMessage policy contract is compatibility-sensitive: Current docs and monitor code define dmPolicy/groupPolicy, groupAllowFrom, access groups, and allowFrom fallback behavior that this PR now applies to outbound paths. Public docs: docs/channels/imessage.md. (docs/channels/imessage.md:246, f8d5f162a129)

Likely related people:

  • steipete: Heavy recent contributor across plugin SDK, channel delivery, iMessage setup, and outbound delivery refactors that this PR builds on. (role: adjacent owner; confidence: high; commits: e4b5027c5e, d163278e9c, b5350bf46f; files: extensions/imessage/src, src/infra/outbound, src/channels/plugins)
  • vincentkoc: Recent iMessage monitor/runtime contributor and current-main history touches the central iMessage send/monitor files. (role: recent area contributor; confidence: medium; commits: ea71a59127, 35a784c165, a8bc1716dd; files: extensions/imessage/src/send.ts, extensions/imessage/src/monitor/monitor-provider.ts)
  • gumadeiras: Recent plugin SDK message action discovery and context work is directly adjacent to requester-sender action dispatch semantics. (role: adjacent owner; confidence: medium; commits: 951f3f992b, a32c7e16d2, a14ad01d66; files: src/channels/plugins, src/infra/outbound)
  • Agustin Rivera: Recent outbound session and media policy fixes overlap the shared outbound delivery/security context touched by this PR. (role: recent adjacent contributor; confidence: medium; commits: 48aae82bbc, c949af9fab; files: src/infra/outbound)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c862c3972b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/imessage/src/send.ts Resolved
Comment thread extensions/imessage/src/send.ts Resolved
Comment thread extensions/imessage/src/send.ts Resolved
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 1, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Jun 1, 2026
@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7d898aa32

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/imessage/src/actions.ts Resolved
Comment thread extensions/imessage/src/send.ts Resolved
Comment thread extensions/imessage/src/send.ts Resolved
Comment thread extensions/imessage/src/send.ts Resolved
@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

@codex review

Follow-up pushed at d8480a894e.

Summary:

  • Replaced the boolean replyContext group shortcut with trusted replyRequesterSender matching.
  • Threaded the trusted sender through iMessage monitor durable/direct reply delivery.
  • Kept explicit action targets on normal group target allowlisting instead of sender-based reply allowance.

Verification:

  • git diff --check
  • node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts
  • env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack pnpm check:changed

No live iMessage private API proof was run from this contributor machine.

@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Follow-up pushed at d8480a894e. The authorization fix now binds sender-based group reply allowance to a trusted inbound sender and removes the previous replyToId-only boolean shortcut.

Local proof:

  • git diff --check
  • node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts
  • env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack pnpm check:changed

No live iMessage private API proof was run from this contributor machine.

@clawsweeper

clawsweeper Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

@codex review

Follow-up pushed in 50c8db0dbc:

  • outbound group sends now use the same effective groupPolicy resolver as inbound iMessage monitoring
  • absent groupAllowFrom falls back to legacy allowFrom; explicit empty groupAllowFrom remains a hard block
  • added send tests for default groupPolicy, fallback, and explicit-empty behavior

Verification:

  • node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts
  • env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack pnpm check:changed
  • git diff --check

@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Follow-up pushed in 50c8db0dbc for the remaining outbound groupPolicy/groupAllowFrom review threads. Tests and check:changed passed locally; please re-review the updated diff.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8480a894e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/imessage/src/send.ts Resolved
Comment thread extensions/imessage/src/send.ts Resolved
Comment thread extensions/imessage/src/send.ts Resolved
@clawsweeper

clawsweeper Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

@codex review

@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa6d130416

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/imessage/src/send.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e41334189

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/imessage/src/actions.ts Resolved
@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

@codex review
@clawsweeper re-review

Review follow-up pushed in 93eec64a42.

Addressed the two fresh Codex review threads:

  • runner-inferred iMessage reply targets now carry an internal inferred-target marker from normalization so same-conversation replies can keep trusted requester sender authorization;
  • caller-supplied inferred-target markers are stripped during normalization, and iMessage only trusts the marker when the marked target matches the current channel;
  • monitor fallback reply ids with trusted requester sender now default to replyToIdSource: implicit while preserving explicit sources.

Verification:

  • node scripts/run-vitest.mjs src/infra/outbound/message-action-normalization.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/monitor/deliver.test.ts (13 infra + 60 iMessage tests)
  • node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/channel.runtime.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.channels.test.ts extensions/imessage/src/targets.test.ts src/infra/outbound/message-action-normalization.test.ts (117 infra + 185 iMessage tests)
  • pnpm exec oxlint src/infra/outbound/message-action-normalization.ts src/infra/outbound/message-action-normalization.test.ts extensions/imessage/src/actions.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/monitor/deliver.ts extensions/imessage/src/monitor/deliver.test.ts
  • git diff --check
  • Sanitized ten-model Ollama Cloud blocker review: first fanout found a spoofable internal marker concern; after hardening, completed lanes reported no merge-blocking issue, with late lanes timing out before producing a blocker.

@clawsweeper

clawsweeper Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93eec64a42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/imessage/src/actions.ts Resolved
Comment thread extensions/imessage/src/send.ts Resolved
Comment thread extensions/imessage/src/actions.ts Resolved
@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

Status after latest follow-up (c643a1f67c65a4943fe98da2381e5d327e63d21c):

  • Addressed and resolved the three latest Codex review threads:
    • mismatched inferred-target aliases
    • consumed implicit reply chunk sender authorization
    • gateway-supplied requester sender spoofing
  • Local validation passed:
    • node scripts/run-vitest.mjs extensions/imessage/src/actions.test.ts extensions/imessage/src/send.test.ts
    • node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/channel.runtime.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.channels.test.ts extensions/imessage/src/targets.test.ts src/infra/outbound/message-action-normalization.test.ts
    • pnpm exec oxlint extensions/imessage/src/actions.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/send.ts extensions/imessage/src/send.test.ts
    • git diff --check
  • GitHub review threads are currently resolved.
  • Current blocker is CI infrastructure/permission, not local code: Scan changed paths (precise) failed during opengrep install with Failed to fetch available versions from GitHub. I attempted gh run rerun 26757246476 --failed, but GitHub rejected it with Must have admin rights to Repository.

Please rerun the failed check or grant an upstream maintainer rerun. I also cannot merge from this account: GitHub returns LDMB123 does not have the correct permissions to execute MergePullRequest.

LDMB123 added 18 commits June 1, 2026 14:42
Preserve sender-handle group reply allowlists for reply sends, treat direct
iMessage/SMS chat identifiers as DM targets, and honor literal wildcard
allowlist entries in outbound iMessage checks.

Verification:
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts
- git diff --check
Treat the auto-service direct chat identifier form as a DM target and add explicit SMS/auto direct-chat allowlist coverage for the outbound gate.

Verification:
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts
- git diff --cached --check
Close the group reply allowlist shortcut so replyToId alone cannot authorize arbitrary group targets.

Thread the trusted inbound sender through monitor reply delivery and use it only for same-context replies, while explicit action targets still require normal group target allowlisting.
Apply the same effective groupPolicy resolution used by inbound iMessage
monitoring to outbound group sends, and preserve the legacy allowFrom
fallback only when groupAllowFrom is absent.

Keep explicit empty groupAllowFrom as a hard block and add regression
coverage for channel default groupPolicy and fallback semantics.
Gate sender-based group reply allowance on the sanitized reply id so malformed reply tags cannot carry requester identity into outbound allowlist checks.

Thread requesterSenderId from the shared outbound delivery session through channel send contexts and the iMessage runtime, preserving trusted reply sender context for durable and attached-result sends.

Verification:
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts extensions/imessage/src/channel.runtime.test.ts src/infra/outbound/deliver.test.ts
- env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack pnpm check:changed
- git diff --check
- git diff --cached --check
Route direct service-handle chat GUIDs through the iMessage DM allowlist path while leaving chat_id and group GUID behavior under group policy.

Stop passing numeric chat ids when sending DM pairing challenges so unpaired users are not blocked by group outbound policy before they receive the pairing code.

Verification:
- git diff --check
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts extensions/imessage/src/channel.runtime.test.ts src/infra/outbound/deliver.test.ts
- env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack pnpm check:changed
Move the iMessage outbound allowlist assertion into a lightweight policy
module so action registration no longer imports the full send runtime.
Keep the previous send.ts export available for internal compatibility.

Verification:
- git diff --cached --check
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/channel.runtime.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts
- CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack pnpm check:changed

Note: the documented Blacksmith Testbox check was rejected by sandbox policy
because it would export unpublished staged code to an external runner.
Require implicit reply metadata before using requester sender allowlist context, enforce disabled iMessage DM policy for outbound sends, and classify raw handle-shaped chat identifiers as direct targets with tighter heuristics.

Verification:
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/channel.runtime.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.channels.test.ts
- node scripts/run-vitest.mjs src/infra/outbound/reply-policy.test.ts src/infra/outbound/message-plan.test.ts
- git diff --check
- pnpm test:changed (host-side rerun after sandbox EPERM/sysctl false negatives)
Tighten the follow-up PR review fixes so fallback delivery no longer
marks payload reply ids as implicit without a verified source, group
mutation actions go through outbound policy before private API mutation,
and direct chat identifiers use one classifier across allowlist and
routing.

Verification:
- node scripts/run-vitest.mjs extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/targets.test.ts extensions/imessage/src/test-plugin.test.ts
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/channel.runtime.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.channels.test.ts extensions/imessage/src/targets.test.ts
- node scripts/run-vitest.mjs src/infra/outbound/reply-policy.test.ts src/infra/outbound/message-plan.test.ts
- git diff --check
- pnpm test:changed
Ensure react, edit, and unsend enforce the outbound allowlist before
private API capability checks, message resolution, or bridge calls.

Add regression coverage that blocked group targets stop before chat
resolution, message resolution, private API probing, or runtime mutation.
Pass payload replyToIdSource through the legacy iMessage fallback delivery path
when the payload already carries an explicit source marker.

Keep bare payload reply ids unchanged so the fallback path does not infer
implicit trust without source proof.
Filter legacy iMessage group allowlist fallback entries to conversation
targets only so DM sender wildcards do not authorize group sends.
Remove a redundant spread from the iMessage group allowlist fallback after
filtering legacy conversation entries. The filtered result is already a fresh
array, so the extra spread only trips the repo lint rule.
Keep explicit group target fallback limited to legacy conversation entries
while allowing implicit trusted replies to use legacy sender and access-group
allowFrom entries when groupAllowFrom is absent.

Verification:
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/channel.runtime.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.channels.test.ts extensions/imessage/src/targets.test.ts
- pnpm exec oxlint extensions/imessage/src/outbound-allowlist.ts extensions/imessage/src/send.test.ts
- git diff --check
- pnpm tsgo:prod
- pnpm check:test-types
- node scripts/check-extension-package-tsc-boundary.mjs --mode=compile
- pnpm lint --threads=8
- Ollama Cloud sanitized ten-model blocker review: 9 no blockers, 1 timed out before final verdict
Track message-action targets that are inferred from the current channel so iMessage reply authorization can keep using trusted requester sender context for same-conversation replies.

Strip caller-supplied inferred-target markers during normalization and require the marked target to match the current channel before treating it as inferred. Also default trusted monitor fallback reply ids to implicit so sender-based group reply allowlists keep working.
Keep inferred iMessage reply targets sender-authorized only when the target actually used for delivery matches the current channel, and ignore gateway-supplied requester identities for sender-based group allowlist checks.

Preserve sender authorization for internally consumed implicit reply chunks while still rejecting malformed reply ids that sanitize away.

Validation:
- node scripts/run-vitest.mjs extensions/imessage/src/actions.test.ts extensions/imessage/src/send.test.ts
- node scripts/run-vitest.mjs extensions/imessage/src/send.test.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/channel.runtime.test.ts extensions/imessage/src/monitor/deliver.test.ts extensions/imessage/src/test-plugin.test.ts extensions/imessage/src/monitor.gating.test.ts src/infra/outbound/deliver.test.ts src/infra/outbound/message.channels.test.ts extensions/imessage/src/targets.test.ts src/infra/outbound/message-action-normalization.test.ts
- pnpm exec oxlint extensions/imessage/src/actions.ts extensions/imessage/src/actions.test.ts extensions/imessage/src/send.ts extensions/imessage/src/send.test.ts
- git diff --check
@openclaw-barnacle openclaw-barnacle Bot removed the app: web-ui App: web-ui label Jun 1, 2026
@LDMB123

LDMB123 commented Jun 1, 2026

Copy link
Copy Markdown
Author

Superseded by consolidated fork-main PR #89224, which carries this branch payload on top of current upstream main.

@LDMB123 LDMB123 closed this Jun 1, 2026
@LDMB123
LDMB123 deleted the codex/upstream-imessage-outbound-allowlist branch June 1, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: imessage Channel integration: imessage merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant