Repository navigation
fix(plugins): sanitize empty marketplace reports - #185374
Leon-SK668 wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
…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]>
|
Thanks @Leon-SK668. This is now fixed at the root in #186502 (3bcca4f), which routes the remaining CLI reports through the shared |
…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
openclaw plugins marketplace list <source>already sanitizes populated marketplaces, but its empty-result branch prints the original source path directly. A valid local marketplace in a directory containing terminal controls can therefore ring the bell or forge report lines simply when listed.Why This Change Was Made
Use the existing
sanitizeTerminalTexton the empty report's source label, at the same human-output boundary as the populated report. The--jsonbranch still returns the original source and manifest values. This closes the missing sibling of merged #178325 without changing marketplace loading or validation.Existing-solutions preflight: the maintained terminal-core/SDK sanitizer already owns this contract, so this reuses it. No new library, wrapper sanitizer, plugin or service is required. The selected complete owner is
src/cli/plugins-marketplace-list-command.ts; its registration, callers, sibling reports, tests, source handling and sanitizer were read. All-state title/symptom/symbol/path searches and complete Leon/Alix public open-footprint/changed-file checks found no viable same-invariant competitor. Latest checked maind94b2dc9c7a6fb81bdda2977ece7322d20d8755bleaves the three report owners, exercised source owners/sanitizer and six publication contracts unchanged from the recorded base.User Impact
Empty marketplace reports remain one safe line; ordinary Unicode and the existing wording remain readable. Machine consumers retain the exact source path, including legitimate characters in local filenames.
No new or changed config/default, protocol/schema, dependency, migration, permission or storage contract. Existing trusted report layout and severity styling are retained. Release-note context: safely render human plugin CLI reports without rewriting machine/raw values.
Evidence
173c8537d5ae4ea1da4200ba59da584b76bb5600. Exact GREEN source/build:8ef2b5111fad3cdbd8a8e5458e10bffd8434d802, tree3b757b18f9d5513f133966036196521254056fcb; clean independent worktree, Node v24.22.1, Linux, task-owned isolated HOME/state/config/files. No production instance, external service, model call or real channel was used.node openclaw.mjs plugins marketplace list <local-marketplace-directory>; full setup, companion calls, original lengths/hashes and complete stdout/stderr are below.5059d75346efe1b42885420e04cd5608999b08d95833eacbb152947679ad7e92; separate disk/SQLite reader SHA2563cde35321991104e90ea6cee5d04f9b16fe3f39e00c902a86014755e67d13e8f. Both RED/GREEN readbacks PASS and launch zero additional product calls. These are saved real subprocess/PTY streams and actual file/SQLite readbacks, not merely test outcomes or script assertions.Commands (one worker; wrapper/preparation time included above):
The local ignored typecheck project only scopes the repository's existing strict test config to the two touched files plus ambient declarations; no compiler/lint setting is weakened. Full Vitest test timing includes startup/compilation; no hosted CI duration is claimed. Diff numstat is additions/deletions:
The two net production lines are the existing sanitizer call and formatter wrapping; no new helper, branch, state or abstraction. Required CI and the first durable bot/human review can only occur after publication; neither is preclaimed here.
The following captures are complete. Within each JSON string, decode
[U+hhhh]to that control code point, and[JSON-ESCAPE-U+hhhh]to a literal backslash, lowercase u and the shown four hex digits. The collision-checked codec round-trips every original string and survives the publication transport. Only task-root/checkout/executable paths are normalized. Hashes/lengths refer to original captured bytes; synthetic fixture values are preserved.Exact native identities and independently reopened disk/SQLite evidence
{ "red": { "head": "173c8537d5ae4ea1da4200ba59da584b76bb5600", "receiptSha256": "dc51c423e0bd942de743b0a43970b6a6110c2ecd832a33ab32777bf080c99c5c", "at": "2026-10-27T02:25:55.794Z", "node": "v24.22.1", "build": { "version": "2026.10.7", "commit": "173c8537d5ae4ea1da4200ba59da584b76bb5600", "builtAt": "2026-10-27T02:13:59.897Z", "buildId": "2026.10.7-173c8537d5ae-2026-10-27T02-13-59.897Z" }, "driverSha256": "5059d75346efe1b42885420e04cd5608999b08d95833eacbb152947679ad7e92", "childElapsedMs": 22851 }, "green": { "head": "8ef2b5111fad3cdbd8a8e5458e10bffd8434d802", "receiptSha256": "01beed5a85f897db98f1c6fca425b6f81a49dd11e771dc6e1bb1854da7e02b07", "at": "2026-10-27T02:55:19.183Z", "node": "v24.22.1", "build": { "version": "2026.10.7", "commit": "8ef2b5111fad3cdbd8a8e5458e10bffd8434d802", "builtAt": "2026-10-27T02:47:43.390Z", "buildId": "2026.10.7-8ef2b5111fad-2026-10-27T02-47-43.390Z" }, "driverSha256": "5059d75346efe1b42885420e04cd5608999b08d95833eacbb152947679ad7e92", "childElapsedMs": 27187 }, "redReadback": { "status": "PASS", "lane": "marketplace", "head": "173c8537d5ae4ea1da4200ba59da584b76bb5600", "phase": "RED", "receiptSha256": "dc51c423e0bd942de743b0a43970b6a6110c2ecd832a33ab32777bf080c99c5c", "readerSha256": "3cde35321991104e90ea6cee5d04f9b16fe3f39e00c902a86014755e67d13e8f", "savedStreams": 12, "files": [ { "path": "<PROOF_ROOT>/ordinary/plain-café-🦀/marketplace.json", "sha256": "cf7d967e902a5bb69e8afb747527ce56f5883f1e8da87c6c78b813c110a53661", "raw": "{\"name\":\"Owned plain-café-🦀\",\"plugins\":[]}\n", "exactSourceReadback": true }, { "path": "<PROOF_ROOT>/ordinary/plain-café-🦀/populated.json", "sha256": "22cf0edc4325e37d5c75b406eeb1e138e0f99e9cf81372a50f933938116df79f", "raw": "{\"name\":\"Owned café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀\",\"plugins\":[{\"name\":\"example\",\"version\":\"1.0.0\",\"source\":\"./demo\"}]}", "exactSourceReadback": true }, { "path": "<PROOF_ROOT>/controls/café\nFORGED[U+0007][U+0085]🦀/marketplace.json", "sha256": "4e33efd13b8cc26388dd54c04fb7b4a034f8c1bf365bc4d0d0ce0896e8e2a609", "raw": "{\"name\":\"Owned café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀\",\"plugins\":[]}\n", "exactSourceReadback": true } ], "sqliteRows": [], "productInvocations": 0 }, "greenReadback": { "status": "PASS", "lane": "marketplace", "head": "8ef2b5111fad3cdbd8a8e5458e10bffd8434d802", "phase": "GREEN", "receiptSha256": "01beed5a85f897db98f1c6fca425b6f81a49dd11e771dc6e1bb1854da7e02b07", "readerSha256": "3cde35321991104e90ea6cee5d04f9b16fe3f39e00c902a86014755e67d13e8f", "savedStreams": 12, "files": [ { "path": "<PROOF_ROOT>/ordinary/plain-café-🦀/marketplace.json", "sha256": "cf7d967e902a5bb69e8afb747527ce56f5883f1e8da87c6c78b813c110a53661", "raw": "{\"name\":\"Owned plain-café-🦀\",\"plugins\":[]}\n", "exactSourceReadback": true }, { "path": "<PROOF_ROOT>/ordinary/plain-café-🦀/populated.json", "sha256": "22cf0edc4325e37d5c75b406eeb1e138e0f99e9cf81372a50f933938116df79f", "raw": "{\"name\":\"Owned café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀\",\"plugins\":[{\"name\":\"example\",\"version\":\"1.0.0\",\"source\":\"./demo\"}]}", "exactSourceReadback": true }, { "path": "<PROOF_ROOT>/controls/café\nFORGED[U+0007][U+0085]🦀/marketplace.json", "sha256": "4e33efd13b8cc26388dd54c04fb7b4a034f8c1bf365bc4d0d0ce0896e8e2a609", "raw": "{\"name\":\"Owned café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀\",\"plugins\":[]}\n", "exactSourceReadback": true } ], "sqliteRows": [], "productInvocations": 0 } }Complete native RED commands and stdout/stderr (6 calls)
[ { "case": "ordinary", "step": "empty-human", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/ordinary/plain-café-🦀" ], "exit": 0, "elapsedMs": 4223, "stdoutBytes": 144, "stderrBytes": 0, "stdoutSha256": "927bec8c4b10489b4721bd9aa1553e3b17cf81a7e410787ca349487888a0863c", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "No plugins found in marketplace <PROOF_ROOT>/ordinary/plain-café-🦀/marketplace.json.\n", "stderr": "" }, { "case": "ordinary", "step": "empty-json", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/ordinary/plain-café-🦀", "--json" ], "exit": 0, "elapsedMs": 3671, "stdoutBytes": 182, "stderrBytes": 0, "stdoutSha256": "acf8d8c3f16b8d744600f706412f759438ee419799523804463123d93ce255d6", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "{\n \"source\": \"<PROOF_ROOT>/ordinary/plain-café-🦀/marketplace.json\",\n \"name\": \"Owned plain-café-🦀\",\n \"plugins\": []\n}\n", "stderr": "" }, { "case": "ordinary", "step": "populated-human", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/ordinary/plain-café-🦀/populated.json" ], "exit": 0, "elapsedMs": 3581, "stdoutBytes": 51, "stderrBytes": 0, "stdoutSha256": "59aace17813e1ddc2f5f53b4a827ba22c18a9aa814c44f003f26a040abde66ba", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "Marketplace Owned café\\nFORGED🦀\nexample v1.0.0\n", "stderr": "" }, { "case": "ordinary", "step": "populated-json", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/ordinary/plain-café-🦀/populated.json", "--json" ], "exit": 0, "elapsedMs": 3491, "stdoutBytes": 330, "stderrBytes": 0, "stdoutSha256": "eb73f55ccd43dc58b860f0ac2f64f827bba7bf09578983bf2dc3cb819b950b37", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "{\n \"source\": \"<PROOF_ROOT>/ordinary/plain-café-🦀/populated.json\",\n \"name\": \"Owned café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀\",\n \"plugins\": [\n {\n \"name\": \"example\",\n \"version\": \"1.0.0\",\n \"source\": {\n \"kind\": \"path\",\n \"path\": \"./demo\"\n }\n }\n ]\n}\n", "stderr": "" }, { "case": "controls", "step": "empty-human", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/controls/café\nFORGED[U+0007][U+0085]🦀" ], "exit": 0, "elapsedMs": 4333, "stdoutBytes": 147, "stderrBytes": 0, "stdoutSha256": "016c7de8382c804b125ebbc448a31387f07ba1da7935f176c38c66e0b8e87cc6", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "No plugins found in marketplace <PROOF_ROOT>/controls/café\nFORGED[U+0007][U+0085]🦀/marketplace.json.\n", "stderr": "" }, { "case": "controls", "step": "empty-json", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/controls/café\nFORGED[U+0007][U+0085]🦀", "--json" ], "exit": 0, "elapsedMs": 3552, "stdoutBytes": 200, "stderrBytes": 0, "stdoutSha256": "0e3d02d8181739a2604f7d0040385a118122a2d9ac895f07f55ed7250ced72d2", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "{\n \"source\": \"<PROOF_ROOT>/controls/café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀/marketplace.json\",\n \"name\": \"Owned café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀\",\n \"plugins\": []\n}\n", "stderr": "" } ]Complete exact-head GREEN commands and stdout/stderr (6 calls)
[ { "case": "ordinary", "step": "empty-human", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/ordinary/plain-café-🦀" ], "exit": 0, "elapsedMs": 5687, "stdoutBytes": 144, "stderrBytes": 0, "stdoutSha256": "9c5f53988fe08310805ca7be146102dacff8c1ea56ab25c3167e1fdd9e5f17a3", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "No plugins found in marketplace <PROOF_ROOT>/ordinary/plain-café-🦀/marketplace.json.\n", "stderr": "" }, { "case": "ordinary", "step": "empty-json", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/ordinary/plain-café-🦀", "--json" ], "exit": 0, "elapsedMs": 3478, "stdoutBytes": 182, "stderrBytes": 0, "stdoutSha256": "c20fc34e862dc0d508be5d4626b5c52a240d57e4236cce530c58e2c20734f765", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "{\n \"source\": \"<PROOF_ROOT>/ordinary/plain-café-🦀/marketplace.json\",\n \"name\": \"Owned plain-café-🦀\",\n \"plugins\": []\n}\n", "stderr": "" }, { "case": "ordinary", "step": "populated-human", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/ordinary/plain-café-🦀/populated.json" ], "exit": 0, "elapsedMs": 4344, "stdoutBytes": 51, "stderrBytes": 0, "stdoutSha256": "59aace17813e1ddc2f5f53b4a827ba22c18a9aa814c44f003f26a040abde66ba", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "Marketplace Owned café\\nFORGED🦀\nexample v1.0.0\n", "stderr": "" }, { "case": "ordinary", "step": "populated-json", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/ordinary/plain-café-🦀/populated.json", "--json" ], "exit": 0, "elapsedMs": 4494, "stdoutBytes": 330, "stderrBytes": 0, "stdoutSha256": "255f9ddf0e81c79c14bd0e8c2fd79d721f9fdc3c34b560c70c0b66cdac42e8e5", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "{\n \"source\": \"<PROOF_ROOT>/ordinary/plain-café-🦀/populated.json\",\n \"name\": \"Owned café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀\",\n \"plugins\": [\n {\n \"name\": \"example\",\n \"version\": \"1.0.0\",\n \"source\": {\n \"kind\": \"path\",\n \"path\": \"./demo\"\n }\n }\n ]\n}\n", "stderr": "" }, { "case": "controls", "step": "empty-human", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/controls/café\nFORGED[U+0007][U+0085]🦀" ], "exit": 0, "elapsedMs": 5519, "stdoutBytes": 145, "stderrBytes": 0, "stdoutSha256": "642bf3d3d20dbbca1ffdbe464e00a95da6bf75340e757fe1c6f7279a5b8999c3", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "No plugins found in marketplace <PROOF_ROOT>/controls/café\\nFORGED🦀/marketplace.json.\n", "stderr": "" }, { "case": "controls", "step": "empty-json", "terminal": false, "executable": "node", "args": [ "<CHECKOUT>/openclaw.mjs", "plugins", "marketplace", "list", "<PROOF_ROOT>/controls/café\nFORGED[U+0007][U+0085]🦀", "--json" ], "exit": 0, "elapsedMs": 3665, "stdoutBytes": 200, "stderrBytes": 0, "stdoutSha256": "6f4f1eb00020c4856413f823a0cdd6f2aa621c32e409926a495e5dc63d2b9ace", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stdout": "{\n \"source\": \"<PROOF_ROOT>/controls/café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀/marketplace.json\",\n \"name\": \"Owned café\\nFORGED[JSON-ESCAPE-U+0007][U+0085]🦀\",\n \"plugins\": []\n}\n", "stderr": "" } ]Not tested: Interactive terminal-emulator screen effects, remote Git marketplaces, cross-OS execution, all Unicode format characters, broad suites and hosted CI were not tested. The native proof captures the real built CLI through pipes; it is not a GUI or rendered-screen claim.
AI-assisted implementation, tests and proof collection. All executions above actually ran. The following excerpt is from the actual local agent transcript; unrelated turns, tool internals, paths and credentials are omitted.
Agent Transcript
Redacted codex session transcript