Skip to content

fix(tlon): never treat group DM authors as the owner - #165801

Merged
eleqtrizit merged 6 commits into
openclaw:mainfrom
eleqtrizit:1071
Oct 13, 2026
Merged

eleqtrizit merged 6 commits into
openclaw:mainfrom
eleqtrizit:1071

Conversation

@eleqtrizit

@eleqtrizit eleqtrizit commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

In Tlon group DMs (clubs), the bot took the message's author field as the sender, and any member of the group can write that field. A member who set it to the operator's ownerShip was treated as the owner: they got the owner approval and admin replies and owner-only commands such as /restart, plus /config and /bash when those are enabled. This change makes group DM messages never count as the owner or as the claimed ship, including when an approved request is replayed later. Group channels behave exactly as before. 1:1 DMs also behave as before, with one exception: DM requests that were already pending approval when the bot is upgraded lose their saved message (see Known limitations). There are no related open PRs.

What Problem This Solves

  1. The sender comes from an unverified field. In extensions/tlon/src/monitor/index.ts, the chat firehose handler sets senderShip = partnerShip || authorShip. For a 1:1 DM, whom is the partner ship. For a club, whom is the club ID, so extractDmPartnerShip (extensions/tlon/src/monitor/utils.ts) returns "" and the sender becomes essay.author. Tlon's chat agent does not tie club message authors to the actual sending ship (group channels do).

  2. That value reaches the owner checks. isOwner(senderShip) gates handleApprovalResponse and handleAdminCommand, selects the owner-only DM allowlist (allowFrom: [senderShip]), and sets SenderRole: "owner".

  3. It also reaches core authorization. sender.id and From carry senderShip, so src/auto-reply/command-auth.ts matches it against commands.ownerAllowFrom and commands.allowFrom, and tools.elevated.allowFrom matches the same SenderId.

  4. Approval replay restored the plain identity. A club claim of a ship that isn't on dmAllowlist queued a DM approval with the message attached. After approval, processApprovedMessage replayed it as the plain claimed ship, so it could match per-ship owner, command, or elevated entries.

  5. Names and stored requests also carried the claim. sender.name stayed the claimed ship, so a name: entry in tools.elevated.allowFrom could match it. DM requests already saved before an upgrade carry no record of where they came from, so a stored group DM claim would still replay as the plain ship.

Net effect: anyone in a group DM with the bot could act as the Gateway owner, or as any other ship.

Why this design

  • Classify a chat event as a club message whenever whom is not a ship. That is the same check that already decides DM routing, and anything that isn't a valid DM partner fails closed as a club.
  • Never treat club messages as the owner. The approval and admin handlers and the owner-only allowlist path are skipped, and SenderRole is always user.
  • Give club messages one club-scoped sender id, club:<club-id>:<claimed-author>, used for ingress, command authorization, sender.id, sender.name, and From. It can never match commands.ownerAllowFrom, commands.allowFrom, tools.elevated.allowFrom (including name: entries), or a channel owner entry.
  • Keep that identity through approvals. Club requests store the club id on the pending approval and replay with the same club-scoped, non-owner identity. A club request never merges into, or overwrites, a verified 1:1 request from the same ship. A club claim of the owner is never stored for replay at all.
  • Fail closed on stored requests whose origin is unknown. New 1:1 DM requests record that they came from a verified DM. A stored DM request without that record (anything saved before this change) is still approvable, which adds the ship to dmAllowlist, but its message is not replayed. The approval confirmation tells the owner the message was not processed and asks them to have the sender send it again.
  • Tell the owner the truth. A club approval request says the sender is an unverified group DM claim, and the model sees the sender labelled as unverified in a group DM.
  • Keep current group DM behavior otherwise. A claimed author on dmAllowlist is still admitted and still gets a private reply, as an ordinary user. Session routing and reply targets are unchanged.
  • No new config, defaults, schema, or SDK surface. The pending-approval record gains two optional fields; existing stored approvals load unchanged.

Evidence

Path Before After
Club message, author = owner, text pending (admin command) Owner admin handler replies with the pending list Not handled as admin; no owner reply
Club message, author = owner, text approve <id> Owner approval handler runs Not handled as an approval
Club message, author = owner, admitted via dmAllowlist sender.id = owner ship, SenderRole: owner, command-authorized sender.id = club:<id>:<ship>, SenderRole: user, CommandAuthorized: false
Club message, author not on dmAllowlist, then owner approves Replayed as the plain claimed ship Replayed as club:<id>:<ship>, SenderRole: user, CommandAuthorized: false
Club message, author = owner, not admitted Processed as the owner Approval queued with no stored message; nothing replays
Club message, tools.elevated.allowFrom has name:<claimed ship> sender.name matches sender.name = club:<id>:<ship>; no match
Stored DM request saved before upgrade, then approved Message replayed as the plain ship Ship allowlisted; message not replayed; owner told to ask for a resend
Settings load of old, new, club, and malformed approval records Old records only Old/new/club records load unchanged; malformed provenance fields rejected
New 1:1 DM request, then approved Replayed as the ship Replayed as the ship (unchanged)
Club message, whom missing / object without ship / non-ship string Sender = claimed author Treated as a club; sender = club:...
Club message, author on dmAllowlist Dispatched as that ship Dispatched, as an ordinary user
Owner 1:1 DM (whom = owner ship) Owner Owner (unchanged)
Owner 1:1 DM admin command Runs Runs (unchanged)

Each fix commit's new tests fail on the commit before it: 4 on the original base, 2 replay/storage tests on the first fix, 4 provenance/name tests on the second, and the resend-notice test on the third. On this head, all pass.

Live run (built gateway, head 45ea335). A gateway built from this branch ran isolated on loopback against a scratch Eyre stand-in that speaks the real login/scry/channel/SSE protocol (not committed). Config: ownerShip: ~nec, commands.ownerAllowFrom: [~nec, ~wes, ~lur], dmAllowlist: [~bus], plus one pre-upgrade pending DM approval for ~bus seeded into the settings store. Events were injected on the real chat /v3 subscription; outcomes are the gateway's own pokes back to the ship and its log lines (redacted).

Live probe results
Probe Observed
Owner 1:1 /whoami (control) Replied to ~nec: User id: ~nec, AllowFrom: ~nec
Club, author ~nec, /whoami No identity reply. Owner got "New group DM message claiming to be from ~nec (unverified; group DM …)"; approval stored without the message
Club, author ~nec, pending (admin) Admin handler did not run; only the approval notice was re-sent
Club, author ~bus (allowlisted), /whoami Admitted as ordinary user; log Command attempt denied: ~bus is not owner; no identity reply
Club, author ~wes (in ownerAllowFrom, not allowlisted) Approval queued, labelled unverified group DM
Owner approves that request ~wes allowlisted; replay logged Command attempt denied: ~wes is not owner despite ~wes being in ownerAllowFrom
Owner approves seeded pre-upgrade request ~bus allowlisted; log Not replaying pre-upgrade DM request from ~bus; owner told "…was not processed. Ask ~bus to send it again."
Owner 1:1 pending (control) Admin handler ran and listed pending approvals

Not covered live: ordinary agent replies (no model credentials in the scratch gateway, so turns completed with no reply payload), name: elevated entries (covered by unit tests), and a real Urbit ship.

Live run 2: elevated tool gate (built gateway, head 45ea335). Same isolated setup, plus a scratch OpenAI-compatible model stub that always asks the real exec tool for elevated: true with a command that writes a marker file. A marker file appearing is the side effect; no marker means exec refused before running anything. Config: tools.elevated.enabled: true, tools.elevated.allowFrom.tlon: [~nec, ~bus, name:~lur, ~wes, ~pod, ~mar], dmAllowlist: [~bus, ~lur], ownerShip: ~nec. The Urbit stand-in persists settings to disk, and the gateway was restarted between the queue and approve phases, so replays below come from approvals reloaded from the settings store (Loaded 4 pending approval(s) from settings).

Elevated probe results
Probe Elevated exec
~nec 1:1 (control, ID match) Ran (marker written)
~bus 1:1 (control, ID match) Ran
~lur 1:1 (control, name:~lur match only) Ran
Club, author ~bus (allowlisted, ID match) Refused: elevated is not available right now … Failing gates: allowFrom (tools.elevated.allowFrom…); no marker
Club, author ~lur (allowlisted, name: match only) Refused (same gate); no marker
Club, author ~nec → restart → owner approves Approval stored without the message; nothing replayed; no exec
Club, author ~wes (ID in elevated list, not allowlisted) → restart → owner approves Replayed after reload; exec refused at the allowFrom gate; no marker
~pod 1:1 (ID in elevated list, not allowlisted) → restart → owner approves Verified DM replayed after reload; elevated exec ran
Seeded pre-upgrade ~mar request → owner approves Allowlisted; not replayed; owner told to ask for a resend
~mar resends in 1:1 Elevated exec ran

The stub model's text replies are generic; the marker files and the [tools] exec failed: elevated is not available log lines are the evidence.

Known limitations

  1. Allowlisted-ship claims in group DMs. Because the club author is unverified, a group DM member can still claim to be a dmAllowlist ship and get ordinary agent replies: no owner, command, or elevated authority. Those replies go by DM to the claimed ship, and the turn lands in that ship's DM session as a user turn (with the default dmScope: main, the shared session already in use). This PR keeps that existing behavior to avoid breaking group DMs. Fully closing it needs either dropping club messages or real club support, both product decisions. A durable fix would be Tlon binding club writ authors to the sending ship, as group channels already do.
  2. Pending DM requests are effectively discarded at upgrade. Approval requests saved before this change carry no record of whether they came from a verified 1:1 DM or an unverified group DM claim, so all of them are treated as unverified. Approving one still adds the ship to dmAllowlist, but the saved message is never processed; the owner is told to ask the sender to send it again. This also applies to genuine 1:1 requests that were pending at upgrade time. It is a one-time effect: every request created after the upgrade records its origin and replays normally. Keeping the old replay would let a forged group DM claim pending at upgrade time replay as the claimed ship.
  3. No real-ship proof. The live run above used a built gateway against a scratch Eyre stand-in, not a real Urbit ship.

SDK / caller upgrade contract

  • Callers affected: only the persisted pending-approval record in the Tlon settings store (PendingApproval in extensions/tlon/src/settings.ts). Two optional fields are added (clubId, verifiedDirect); no existing field changes shape or meaning.
  • Who keeps access: all pre-existing records stay readable and approvable. The parser accepts records with and without the new fields, including malformed-field records (extensions/tlon/src/settings.test.ts covers pre-upgrade, current, club, and malformed records through the real settings-load parser).
  • Who fails closed: saved messages in pre-upgrade records (no provenance) are never replayed; approval still allowlists the ship and the owner is told to request a resend. Club-originated records replay only with the club-scoped, non-owner identity; a club record claiming the owner was never stored for replay.
  • Recovery after upgrade: covered end to end — a pre-upgrade approval stored in the settings store survived a gateway restart, was approved after reload, produced the resend notice, and a resend in a fresh verified 1:1 DM replayed with elevated access (live run 2 table above). Verified 1:1 and club records created after the change persist and replay across a restart in the same run.
  • No migration step: the added fields are optional and written on new records only; old records load unchanged and no settings rewrite is needed.

Testing

  • New: extensions/tlon/src/monitor/index.club-sender.test.ts (15 tests): forged-owner admin, forged-owner approval, forged-owner identity/name/role/command auth, allowlisted club user, approved club claim replays with club identity, club owner claim not stored for replay, three malformed-whom cases (also asserting the owner ship never reaches ingress), pre-upgrade vs verified stored DM approvals, provenance recorded on new requests, owner 1:1 DM identity, owner 1:1 DM admin command. Plus one approval-runtime.test.ts case (provenance follows the stored message when a request is updated), one settings.test.ts case (pre-upgrade, current, club, and malformed approval records through the real settings-load parser), and one approval.test.ts case (the club approval notice says the message is answered only when it was stored for replay, and otherwise tells the owner a fresh verified DM is needed).
  • pnpm exec vitest run extensions/tlon: 40 files, 390 tests passed.
  • pnpm tsgo:extensions and pnpm tsgo:extensions:test pass; pnpm check:assertion-safety --base upstream/main passes; oxfmt and oxlint clean on the touched files.
  • Docs: docs/channels/tlon.md now states that owner commands and approvals only work in a 1:1 DM, and that pre-upgrade DM requests are approvable but not replayed.

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: tlon Channel integration: tlon size: M labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR prevents unverified Tlon group-DM author claims from gaining ship privileges and preserves that restriction through approval replay.

Example: A club member sends a message claiming author ~nec, the configured owner.

  • Before: The message can reach owner approval handlers and match ship-based command or elevated-tool permissions.
  • After: The sender becomes club:0v3.club:~nec with user role, and the claimed ship grants no owner authority.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct privilege fix with production Gateway evidence and persisted-state recovery coverage; transport proof uses an Eyre stand-in.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied built-Gateway runs exercise Tlon HTTP/SSE ingress, real command and elevated-exec gates, settings reload, and approval replay: direct-message controls execute, forged club ID/name claims refuse before marker-file I/O, and markerless requests recover through the resend notice; real Urbit ship behavior is explicitly untested.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A Tlon club member can claim another ship and gain its owner or elevated privileges.
Reason: The change restores sender trust boundaries; ordinary club admission and routing remain intentionally unchanged, and the upgrade resend tradeoff is recorded as accepted.

Merge readiness

✅ Ready for maintainer review

This PR fixes a privilege bypass still present on main and in v2026.10.2; the reviewed patch has no actionable introduced defects.

Priority: P0
Reviewed head: a06de16386d0a039ff86a9d849e426b4b52d6f0f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Tlon plugin receives Urbit chat events, resolves sender access, persists pending approvals, and passes admitted messages into Gateway command and agent execution.

flowchart TD
  A[Urbit chat events] --> B[Tlon sender classification]
  B --> C[Ingress authorization]
  C --> D[Pending approval store]
  D --> B
  C --> E[Gateway commands and agent]
  E --> F[Tlon replies and tool effects]
Loading

Technical review

Best possible solution:

Land the scoped privilege fix with the accepted resend behavior while retaining ordinary club delivery within its documented limits.

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

Main and v2026.10.2 visibly route a non-ship chat conversation through its claimed author into owner checks; the supplied Gateway probes exercise forged club claims and authenticated controls.

Is this the best way to solve the issue?

The patch fixes identity at the Tlon boundary, carries it through replay, and prevents name-based privilege matching without introducing a competing core authorization owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e3ec1f2eeaf6.

Provenance checked

  • Club author fallback and owner authorization changes intended behavior with a stated reason (f468274: The expanded Tlon integration introduced DM routing, owner permissions, and approval handling; later durable-ingress and cleanup changes carried this behavior forward.)
  • Approval storage and replay changes intended behavior with a stated reason (feat: update tlon channel/plugin to be more fully featured #21208: Saved unauthorized messages were replayed after owner approval; the PR explains why originless saved DMs cannot safely retain that privilege-bearing identity.)
  • Approval runtime ownership keeps the original intent (b86bc9d: Approval operations were split out of the monitor; this patch extends that existing owner and preserves bounded admission and stored-request ordering.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +120, Tests +427, Docs +10. Total +557 across 9 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 4 141 21 +120
Tests 4 427 0 +427
Docs 1 10 0 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 578 21 +557

Review metrics

Metric Value Why it matters
Production versus test growth Production +141/-21 lines; tests +427 lines Production growth carries unverified identity and persisted provenance through existing owners; test growth covers distinct owner, replay, malformed-input, and upgrade contracts.
Persisted approval additions 2 optional provenance fields; 0 new configuration options clubId and verifiedDirect preserve new-request origin without requiring an existing-record migration.

Root-cause cluster

Relationship: canonical
Canonical: #165801
Summary: This PR owns the restarted club-author privilege fix after the earlier broader implementation was closed unmerged.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P0: The affected shipped path can grant owner commands and elevated execution to a forged club author.
  • merge-risk: 🚨 compatibility: Approving pre-upgrade pending DMs deliberately stops replaying their saved messages; the recorded maintainer decision accepts this one-time resend cost.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-06T01:48:20.870Z sha 45ea33572319bf7a970d28990cae92f71680bfa3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-06T02:14:31.553Z sha 45ea33572319bf7a970d28990cae92f71680bfa3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-06T04:39:32.744Z sha 45ea33572319bf7a970d28990cae92f71680bfa3 :: blocked before merge. :: none
  • reviewed 2026-10-07T23:34:52.612Z sha 45ea33572319bf7a970d28990cae92f71680bfa3 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-08T16:45:47.979Z sha 54b9b17d6b778b5c5dfde7602eabeb46a9cdb5f4 :: needs changes before merge. :: [P3] Describe suppressed owner-claim messages accurately
  • reviewed 2026-10-12T16:46:12.077Z sha 499c2bb69067a73e8d57a315d6d16b03c3042467 :: needs changes before merge. :: none
  • reviewed 2026-10-12T17:35:50.456Z sha d2d1bbc66101f58119e960b2bb92d7b0e971ebaf :: blocked before merge. :: none
  • reviewed 2026-10-12T17:56:02.228Z sha d2d1bbc66101f58119e960b2bb92d7b0e971ebaf :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 5:59 PM ET / 21:59 UTC (Revision 13).

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Oct 5, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 6, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 6, 2026
@eleqtrizit

Copy link
Copy Markdown
Contributor Author

Maintainer decision on the upgrade tradeoff: accepted.

I accept the one-time resend policy for all markerless pending DM approvals (requests saved before this change, without the new verifiedDirect or clubId provenance):

  • Approving such a request still adds the ship to the DM allowlist.
  • Its saved message is not replayed, including genuine 1:1 requests, because stored records can't distinguish an authenticated DM from a forged group DM claim.
  • The owner's approval confirmation says the earlier message wasn't processed and asks them to have the sender resend it.

This is a one-time cost at upgrade. Requests created after this change carry provenance and replay normally: verified 1:1 DMs replay as the ship, and group DM requests replay only with the club-scoped, non-owner identity. The live runs in the PR body show approval with the resend notice, a successful resend, and a verified DM replaying after restart.

@eleqtrizit
eleqtrizit marked this pull request as ready for review October 7, 2026 23:26
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 7, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@eleqtrizit

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
@eleqtrizit

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 12, 2026
Group DM (club) events identify the conversation, not the sender, so the
author field is whatever the sending ship wrote. Stop letting that claim
reach owner approval/admin handlers, owner command authorization, or the
owner sender identity. 1:1 DMs and group channels are unchanged.
A group DM (club) claim that queued a DM approval was replayed after
approval as the plain claimed ship, so it could match per-ship command,
owner, or elevated allowlists. Carry the club id on the pending approval,
replay with the club-scoped non-owner identity, keep club claims from
merging into verified 1:1 requests, label club approvals as unverified,
and document that owner actions need a 1:1 DM.
Pending DM approvals saved before group DM provenance existed cannot be
told apart from unverified group DM claims. Record verified 1:1 DM
provenance on new requests and stop replaying stored messages without
it; approval still allowlists the ship. Also give group DM senders the
club-scoped identity as their display name so name-based elevated
allowlist entries cannot match an unverified claim.
Approving a DM request saved before sender provenance existed allowlists
the ship but deliberately does not replay its stored message. Say so in
the approval confirmation so the owner asks the sender to resend, and
cover old and new persisted approval records at settings load.
@eleqtrizit

Copy link
Copy Markdown
Contributor Author

Merge record

Summary: Closes a Tlon privilege escalation where any group DM (club) member could forge the message author to act as the owner or any allowlisted ship. Group DM senders now carry a club-scoped, non-owner identity end to end — ingress allowlist, admin commands, elevated tool gates, and approval replay — while 1:1 DMs and group channels behave as before. Approving a DM request saved before this change skips replaying its stored message and asks the sender to resend; that one-time upgrade cost is accepted by the maintainer.

Decision Reason for Merge: ClawSweeper's final review reported no findings and no before-merge blockers ("ready for maintainer look"), the maintainer's recorded acceptance (#165801 (comment)) covers the only behavioral tradeoff, and all required checks passed on the final head.

Compatibility Checks Done: Full CI green on the final head, including the channel-runtime-boundary quality lane and the ci-gate summary. Locally: tlon test suites (304 tests), tsgo:extensions and tsgo:extensions:test, oxfmt/oxlint on all changed files, and the assertion-safety ratchet against upstream/main. Stored-data compatibility is covered by parser tests (pre-upgrade, current, club, and malformed approval records) and live persistence runs (gateway restart reloading saved approvals, resend recovery, verified-DM replay). No config surface changed; two optional persisted fields added (clubId, verifiedDirect).

@eleqtrizit
eleqtrizit merged commit 0538c07 into openclaw:main Oct 13, 2026
98 checks passed
@eleqtrizit
eleqtrizit deleted the 1071 branch October 13, 2026 19:01
RomneyDa pushed a commit that referenced this pull request Oct 14, 2026
* fix(tlon): never treat group DM authors as the owner

Group DM (club) events identify the conversation, not the sender, so the
author field is whatever the sending ship wrote. Stop letting that claim
reach owner approval/admin handlers, owner command authorization, or the
owner sender identity. 1:1 DMs and group channels are unchanged.

* fix(tlon): keep group DM identity through approval replay

A group DM (club) claim that queued a DM approval was replayed after
approval as the plain claimed ship, so it could match per-ship command,
owner, or elevated allowlists. Carry the club id on the pending approval,
replay with the club-scoped non-owner identity, keep club claims from
merging into verified 1:1 requests, label club approvals as unverified,
and document that owner actions need a 1:1 DM.

* fix(tlon): close legacy approval replay and name matching for group DMs

Pending DM approvals saved before group DM provenance existed cannot be
told apart from unverified group DM claims. Record verified 1:1 DM
provenance on new requests and stop replaying stored messages without
it; approval still allowlists the ship. Also give group DM senders the
club-scoped identity as their display name so name-based elevated
allowlist entries cannot match an unverified claim.

* fix(tlon): tell the owner when a pre-upgrade DM request must be resent

Approving a DM request saved before sender provenance existed allowlists
the ship but deliberately does not replay its stored message. Say so in
the approval confirmation so the owner asks the sender to resend, and
cover old and new persisted approval records at settings load.

* fix(tlon): make the club approval replay explanation conditional

* style(tlon): format the approval notice test

(cherry picked from commit 0538c07)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
* fix(tlon): never treat group DM authors as the owner

Group DM (club) events identify the conversation, not the sender, so the
author field is whatever the sending ship wrote. Stop letting that claim
reach owner approval/admin handlers, owner command authorization, or the
owner sender identity. 1:1 DMs and group channels are unchanged.

* fix(tlon): keep group DM identity through approval replay

A group DM (club) claim that queued a DM approval was replayed after
approval as the plain claimed ship, so it could match per-ship command,
owner, or elevated allowlists. Carry the club id on the pending approval,
replay with the club-scoped non-owner identity, keep club claims from
merging into verified 1:1 requests, label club approvals as unverified,
and document that owner actions need a 1:1 DM.

* fix(tlon): close legacy approval replay and name matching for group DMs

Pending DM approvals saved before group DM provenance existed cannot be
told apart from unverified group DM claims. Record verified 1:1 DM
provenance on new requests and stop replaying stored messages without
it; approval still allowlists the ship. Also give group DM senders the
club-scoped identity as their display name so name-based elevated
allowlist entries cannot match an unverified claim.

* fix(tlon): tell the owner when a pre-upgrade DM request must be resent

Approving a DM request saved before sender provenance existed allowlists
the ship but deliberately does not replay its stored message. Say so in
the approval confirmation so the owner asks the sender to resend, and
cover old and new persisted approval records at settings load.

* fix(tlon): make the club approval replay explanation conditional

* style(tlon): format the approval notice test
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Oct 16, 2026
* fix(tlon): never treat group DM authors as the owner

Group DM (club) events identify the conversation, not the sender, so the
author field is whatever the sending ship wrote. Stop letting that claim
reach owner approval/admin handlers, owner command authorization, or the
owner sender identity. 1:1 DMs and group channels are unchanged.

* fix(tlon): keep group DM identity through approval replay

A group DM (club) claim that queued a DM approval was replayed after
approval as the plain claimed ship, so it could match per-ship command,
owner, or elevated allowlists. Carry the club id on the pending approval,
replay with the club-scoped non-owner identity, keep club claims from
merging into verified 1:1 requests, label club approvals as unverified,
and document that owner actions need a 1:1 DM.

* fix(tlon): close legacy approval replay and name matching for group DMs

Pending DM approvals saved before group DM provenance existed cannot be
told apart from unverified group DM claims. Record verified 1:1 DM
provenance on new requests and stop replaying stored messages without
it; approval still allowlists the ship. Also give group DM senders the
club-scoped identity as their display name so name-based elevated
allowlist entries cannot match an unverified claim.

* fix(tlon): tell the owner when a pre-upgrade DM request must be resent

Approving a DM request saved before sender provenance existed allowlists
the ship but deliberately does not replay its stored message. Say so in
the approval confirmation so the owner asks the sender to resend, and
cover old and new persisted approval records at settings load.

* fix(tlon): make the club approval replay explanation conditional

* style(tlon): format the approval notice test

(cherry picked from commit 0538c07)

Backport adaptation: release branch reads effectiveOwnerShip/effectiveDmAllowlist as monitor locals instead of settingsState fields.
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
* fix(tlon): never treat group DM authors as the owner

Group DM (club) events identify the conversation, not the sender, so the
author field is whatever the sending ship wrote. Stop letting that claim
reach owner approval/admin handlers, owner command authorization, or the
owner sender identity. 1:1 DMs and group channels are unchanged.

* fix(tlon): keep group DM identity through approval replay

A group DM (club) claim that queued a DM approval was replayed after
approval as the plain claimed ship, so it could match per-ship command,
owner, or elevated allowlists. Carry the club id on the pending approval,
replay with the club-scoped non-owner identity, keep club claims from
merging into verified 1:1 requests, label club approvals as unverified,
and document that owner actions need a 1:1 DM.

* fix(tlon): close legacy approval replay and name matching for group DMs

Pending DM approvals saved before group DM provenance existed cannot be
told apart from unverified group DM claims. Record verified 1:1 DM
provenance on new requests and stop replaying stored messages without
it; approval still allowlists the ship. Also give group DM senders the
club-scoped identity as their display name so name-based elevated
allowlist entries cannot match an unverified claim.

* fix(tlon): tell the owner when a pre-upgrade DM request must be resent

Approving a DM request saved before sender provenance existed allowlists
the ship but deliberately does not replay its stored message. Say so in
the approval confirmation so the owner asks the sender to resend, and
cover old and new persisted approval records at settings load.

* fix(tlon): make the club approval replay explanation conditional

* style(tlon): format the approval notice test

(cherry picked from commit 0538c07)
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: tlon Channel integration: tlon docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant