Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR removes bidirectional formatting controls from pending node-pairing table cells while preserving printable right-to-left letters. Example: A pending node supplies displayName Owner\u2067\u202EenohPi s\u202Cbox.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Current main already covers this PR through #186502, but the recorded maintainer direction explicitly reserves closure for the assignee, fuller-stack-dev. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe nodes CLI parses pending requests returned by the Gateway and renders their identifiers, names, and IP addresses into an operator-facing terminal table. flowchart LR
A[Pending node request] --> B[Gateway pairing list]
B --> C[CLI pairing parser]
C --> D[Pending table renderer]
D --> E[Terminal text sanitizer]
E --> F[Operator terminal]
Technical reviewBest possible solution: Retain the merged shared-owner fix and let fuller-stack-dev decide this PR's disposition with arpe1618's contribution credited. Do we have a high-confidence way to reproduce the issue? The original source path allowed bidi controls through, but current main removes them through the shared sanitizer; no target code was executed during this read-only review. Is this the best way to solve the issue? The merged shared-owner implementation solves the same problem without retaining a separate pairing-specific bidi policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b2ecb073b2cf; fix evidence: commit 3bcca4f468ea, main fix timestamp 2026-10-28T05:12:57Z. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +11, Tests +42. Total +53 across 2 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
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 HistoryReview history (10 earlier review cycles; latest 8 shown)
Reviewed October 28, 2026, 1:55 AM ET / 05:55 UTC (Revision 11). |
43eb520 to
452148e
Compare
f887f6b to
e039c80
Compare
|
Added the affected-CLI-flow proof: a new test in |
e039c80 to
76e14a7
Compare
A node sets its own displayName in the pairing request, and `nodes status` renders it verbatim in the pending-request table that an operator reads to approve the device. sanitizeTerminalText escapes C0/C1 controls but passes bidirectional formatting controls (overrides, isolates, marks, the Arabic letter mark) through, so a device could name itself `Owner<RLI><RLO>enohPi s<PDF>box` and render as "Owner's iPhone" in the approval list (Trojan Source, CVE-2021-42574). Strip those controls in the pairing renderer before display. The fix is local to this approval surface rather than in shared sanitizeTerminalText, because other consumers of that helper (for example codex catalog previews) rely on formatting characters passing through. Strong-directional letters are not controls, so a right-to-left device name still renders its letters.
76e14a7 to
fd7d938
Compare
|
Reworked to a narrower, correct fix. A CI run surfaced that shared |
|
Updated Evidence with before/after output captured from the production |
|
Addressed the remaining proof point directly. The renderer is not separate from the CLI: |
…amilies (#186502) fix(cli): route remaining CLI reports through the terminal-text owner After #185927 added one owner for escaping untrusted values in CLI output, contributors kept opening one PR per command to escape the next report. This moves the remaining human-readable reports in the plugins, secrets, sessions, memory and memory-wiki, workboard, backup, pairing, oc-path, config and setup commands onto `terminalText` / `displayPath`, and extends the owner to neutralize bidirectional control characters. JSON output, persisted identities, raw exports and the CLI's own colors are unchanged, and the trusted styling of `renderTable` is untouched. This absorbs the per-site fixes from @Leon-SK668 (#184454, #184379, #185374, #186449, #184396, #184788, #184813, #184394), @huwei-xydt (#185895, #185719), @wangmiao0668000666 (#175600, #175181, #175179), @SunnyShu0925 (#184747), @KrasimirKralev (#184597) and @arpe1618 (#150599), whose original commits are kept. Families no PR touched (update, Doctor, install-trust producers and others) are listed under "Not fixed here". Evidence: 85 built-CLI invocations per ref with crafted control and bidi characters in the reported values, captured as raw stdout bytes. Main printed the raw sequences; this change printed them neutralized, with identical normal colors and unchanged JSON. Details: #186502 (comment). Co-authored-by: 胡伟0668000622 <[email protected]> Co-authored-by: Claude Code <[email protected]> Co-authored-by: Leon-SK668 <[email protected]> Co-authored-by: wangmiao0668000666 <[email protected]> Co-authored-by: SunnyShu <0668000539@local> Co-authored-by: Krasimir Kralev <[email protected]> Co-authored-by: arpe1618 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
|
@fuller-stack-dev: #186502 (3bcca4f) routes the covered CLI report families through the shared Rechecked against current main |
…amilies (openclaw#186502) fix(cli): route remaining CLI reports through the terminal-text owner After openclaw#185927 added one owner for escaping untrusted values in CLI output, contributors kept opening one PR per command to escape the next report. This moves the remaining human-readable reports in the plugins, secrets, sessions, memory and memory-wiki, workboard, backup, pairing, oc-path, config and setup commands onto `terminalText` / `displayPath`, and extends the owner to neutralize bidirectional control characters. JSON output, persisted identities, raw exports and the CLI's own colors are unchanged, and the trusted styling of `renderTable` is untouched. This absorbs the per-site fixes from @Leon-SK668 (openclaw#184454, openclaw#184379, openclaw#185374, openclaw#186449, openclaw#184396, openclaw#184788, openclaw#184813, openclaw#184394), @huwei-xydt (openclaw#185895, openclaw#185719), @wangmiao0668000666 (openclaw#175600, openclaw#175181, openclaw#175179), @SunnyShu0925 (openclaw#184747), @KrasimirKralev (openclaw#184597) and @arpe1618 (openclaw#150599), whose original commits are kept. Families no PR touched (update, Doctor, install-trust producers and others) are listed under "Not fixed here". Evidence: 85 built-CLI invocations per ref with crafted control and bidi characters in the reported values, captured as raw stdout bytes. Main printed the raw sequences; this change printed them neutralized, with identical normal colors and unchanged JSON. Details: openclaw#186502 (comment). Co-authored-by: 胡伟0668000622 <[email protected]> Co-authored-by: Claude Code <[email protected]> Co-authored-by: Leon-SK668 <[email protected]> Co-authored-by: wangmiao0668000666 <[email protected]> Co-authored-by: SunnyShu <0668000539@local> Co-authored-by: Krasimir Kralev <[email protected]> Co-authored-by: arpe1618 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
A node sets its own
displayNamein the pairing request.openclaw nodes statusrenders it verbatim in the pending-request table an operator reads to approve the
device (
renderPendingPairingRequestsTable).sanitizeTerminalTextescapes C0/C1controls but passes bidirectional formatting controls through: overrides
(U+202A-202E), isolates (U+2066-2069), marks (U+200E/200F), and the Arabic letter
mark (U+061C) are category Cf. Those characters are invisible but reorder the
glyphs around them, so a device can name itself
Owner+ U+2067 + U+202E +enohPi s+ U+202C +boxand render as"Owner's iPhone" in the approval list (Trojan Source, CVE-2021-42574), letting an
attacker's device impersonate a trusted one.
Why This Change Was Made
The pairing renderer now removes bidirectional controls from each displayed cell.
The fix is local to this approval surface rather than in shared
sanitizeTerminalText, because other consumers of that helper (for example codexcatalog previews, which have an explicit test for it) rely on formatting
characters passing through. Strong-directional letters are not controls, so a
right-to-left device name still renders its letters.
User Impact
The pending-pairing table can no longer be reordered or spoofed by a crafted
device name. A bidirectional control in a displayed name, request id, or IP is
dropped; ordinary text, including right-to-left letters, is unchanged.
Evidence
CLI call path -- the renderer is what
openclaw nodes listprints, unchanged(
src/cli/nodes-cli/register.status.ts):The Gateway
node.pair.listhandler returns the stored pending requests(
listNodePairing), including the device-supplieddisplayName, and the CLIprints
rendered.tableverbatim. Nothing transforms the string between therenderer and
defaultRuntime.log, so the renderer output below is exactly theterminal output for the pending rows the Gateway returns.
Captured from the real
renderPendingPairingRequestsTable, the function thenodes listpending table prints. A pending request whosedisplayNameisOwner+ U+2067 + U+202E +enohPi s+ U+202C +boxproduces the Node cell(other columns trimmed):
Before (current
main), the override reaches the terminal and the row reorders toread "Owner's iPhone":
Bidirectional controls present in the rendered table: U+2067, U+202E, U+202C.
After this change:
Bidirectional controls present in the rendered table: none.
New tests in
src/cli/nodes-cli/pairing-render.test.tsassert this on theproduction render path and confirm a right-to-left name such as
שלום Phonestillrenders its letters.