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 maintainer review before merge. What this changesSanitize untrusted text in human-readable installed-plugin reports while preserving raw JSON metadata and trusted styling. Example: Run
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current terminal-output defect with a focused patch, credible built-CLI evidence, and no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherInstalled-plugin manifests and discovery diagnostics become inventory and inspection reports; CLI renderers produce human-readable terminal output or structured JSON. flowchart LR
A[Installed plugin manifests] --> B[Metadata discovery]
B --> C[Plugin reports]
C --> D[Human report renderers]
D --> E[Canonical terminal sanitizer]
E --> F[Terminal output]
C --> G[Raw JSON serialization]
Technical reviewBest possible solution: Land the focused sanitization at the existing human report owners while retaining raw JSON and trusted styling. Do we have a high-confidence way to reproduce the issue? The manifest projector preserves the offending metadata and current-main renderers print it directly; the contributor also supplies historical failing CLI output and current-head corrected output, which I inspected without executing target code. Is this the best way to solve the issue? The patch uses the canonical terminal filter at the existing output boundaries, preserving structured data, lifecycle behavior, source formatting, and status colors without introducing additional machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fb28b4d8f7de. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +24, Tests +153. Total +177 across 4 files. Added test files: 1. View PR surface stats
Review metrics
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 HistoryReviewed October 25, 2026, 9:40 AM ET / 13:40 UTC (Revision 3). |
|
@clawsweeper re-review Updated product head: Related list/format/inspect suites passed; the added missing-ID human control first failed while JSON passed, then the final terminal suite passed 11/11. Type-aware lint/format and independent source/test review PASS. Normal cliStartup build has a clean exact-head stamp. The current-head proof receipt includes the exact entry, canonical owner, readback, controls, cleanup and limitations. Required hosted CI is tracked separately; no all-green CI or maintainer product acceptance is claimed. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Updated head: The updated Evidence records current verification and the exact reuse boundaries. Required CI is green on this head. Independent source review and publication preflight passed. Any existing maintainer product/compatibility decision remains pending; this update does not imply acceptance. |
|
🦞👀 Re-review progress:
|
…ll preview The uninstall preview sanitizes the manifest display name (openclaw#183708) but renders preview.pluginId and package-entry ids raw. Local-path installs only path-validate ids (validatePluginId), so a manifest id carrying ESC/BEL reaches the dry-run preview terminal output unchanged, bypassing the name sanitization. Strip control characters from the owner id and package entry ids with the existing sanitizeTerminalText helper, matching the id handling in plugins list/inspect (openclaw#172873).
fix(cli): escape terminal controls in untrusted values through one owner CLI human-readable output printed user-controlled values such as config paths, names, directories, binding descriptions, plugin metadata and dead-letter scopes without neutralizing terminal control sequences, so a crafted value could inject ANSI, OSC 8 or C1 sequences into the terminal. Earlier fixes wrapped one call site at a time. A single owner now does this: `terminalText` in terminal-core's safe-text escapes interpolated values before styling, and the display-only `displayPath` delegates to it. Raw path shortening, JSON output and the trusted styling of `renderTable` are unchanged, and the per-site wrapping is replaced. This absorbs #184685, #184666, #184324, #184303, #176763, #176773 and #172873 by @Alix-007 and #184861 by @qingminglong, whose original commits are kept, and moves the earlier merged per-site fixes onto the same owner. Evidence: built CLI in a secretless container, with ESC/CSI, OSC 8 and C1 sequences injected into values for eleven commands across eight families. Main printed the raw sequences; this change printed them neutralized, normal colored output and JSON values were unchanged, and dead-letter errors keep their stderr and JSON contracts. Raw-byte captures: #185927 (comment). Production +81. Co-authored-by: Alix-007 <[email protected]> Co-authored-by: qingminlong <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
|
@shakkernerd: #185927 (2d2b465) landed a root-cause fix that routes the covered CLI report values through one Rechecked against current main |
fix(cli): escape terminal controls in untrusted values through one owner CLI human-readable output printed user-controlled values such as config paths, names, directories, binding descriptions, plugin metadata and dead-letter scopes without neutralizing terminal control sequences, so a crafted value could inject ANSI, OSC 8 or C1 sequences into the terminal. Earlier fixes wrapped one call site at a time. A single owner now does this: `terminalText` in terminal-core's safe-text escapes interpolated values before styling, and the display-only `displayPath` delegates to it. Raw path shortening, JSON output and the trusted styling of `renderTable` are unchanged, and the per-site wrapping is replaced. This absorbs openclaw#184685, openclaw#184666, openclaw#184324, openclaw#184303, openclaw#176763, openclaw#176773 and openclaw#172873 by @Alix-007 and openclaw#184861 by @qingminglong, whose original commits are kept, and moves the earlier merged per-site fixes onto the same owner. Evidence: built CLI in a secretless container, with ESC/CSI, OSC 8 and C1 sequences injected into values for eleven commands across eight families. Main printed the raw sequences; this change printed them neutralized, normal colored output and JSON values were unchanged, and dead-letter errors keep their stderr and JSON contracts. Raw-byte captures: openclaw#185927 (comment). Production +81. Co-authored-by: Alix-007 <[email protected]> Co-authored-by: qingminlong <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @obviyus for verifying the plugin reports against the shared fix. Appreciate you taking the time to follow up. |
|
Hi @shakkernerd, could you take a look at the final disposition here when you have a chance? It's been open for over a week; #185927 already includes the fix with co-author credit. Thanks! |
|
Closing this as absorbed by the merged #185927, with contributor credit retained. Thanks @obviyus for integrating the fix, and @shakkernerd for taking a look! |
What Problem This Solves
Fixes installed plugin metadata and discovery diagnostics emitting terminal control sequences during
plugins listandplugins inspect.User Impact
Operators can inspect installed plugins without manifest strings changing terminal state. Normal plugin labels, versions, and trusted status colors remain readable. Report JSON retains its raw metadata values; there are no new settings, permissions, protocols, schemas, or migration steps.
Why This Change Was Made
Apply the existing canonical terminal filter at human list and inspection boundaries, including verbose/all modes and global diagnostic stderr. Filter untrusted table cells before trusted status styling. Plugin discovery, enablement, runtime loading, and structured report data retain their existing behavior.
Evidence
Current-head maintenance
662557a4301c7347ffd185b81b1f7c66982c2fd8; integrated main:27e7e5ee87ccbc1cfa11b7e0b79d78bbf503280f; clean reviewed tree:8a6cf30d798eb3571014cf39581e06339420c795. Original contribution and authentic merge parents are retained.node proof-reports.mjs "$CHECKOUT" green plugins(Node 26.12.1, isolated synthetic state). Actual command, process excerpts, independent readback and original baseline evidence are inline below; source hashes identify the local collectors.pnpm build cliStartuppassed with a matching clean-head buildstamp before this collector ran. This does not claim the full release/package build.Current-head CLI execution and independent readback receipt
{ "observedAt": "2026-10-25T12:58:43.604Z", "head": "662557a4301c7347ffd185b81b1f7c66982c2fd8", "tree": "8a6cf30d798eb3571014cf39581e06339420c795", "integratedMain": "27e7e5ee87ccbc1cfa11b7e0b79d78bbf503280f", "result": "PASS", "buildProfile": "cliStartup", "buildStamp": { "builtAt": 1792932996147, "head": "662557a4301c7347ffd185b81b1f7c66982c2fd8", "inputsClean": true, "inputSignature": "3ada7021df66c10d9e3247d0f05735f5189215e3c5aa64db18996af5f30d07aa" }, "harnessSha256": "0b8761cd91c01774a724a683e649c24c597f502ac1092a9409540c524b5cb9a8", "receiptSha256": "5348f7a18f7aed69af177cb1810ef27a39d3bef0fcfd4ac16eb5672de30bb8bb", "observations": [ { "label": "plugin-list-verbose", "controlBytes": 0, "expected": "PLUGIN_MARKER" }, { "label": "plugin-inspect", "controlBytes": 0, "expected": "PLUGIN_MARKER" }, { "label": "legal-plugin-list-verbose", "controlBytes": 0, "expected": "PLUGIN_MARKER" }, { "label": "legal-plugin-inspect", "controlBytes": 0, "expected": "PLUGIN_DESCRIPTION" }, { "label": "missing-plugin-human", "controlBytes": 0, "rawIdPreservedInJson": true } ], "runs": [ { "name": "plugin-list-verbose", "args": [ "plugins", "list", "--verbose" ], "exit": 0, "stdout": "Plugins (0/177 enabled)\nTrust is provenance, not a code-safety guarantee.\nPLUGIN_MARKER (report-plugin) disabled\n format: openclaw\n source: <fixture>/plugin/index.js\n origin: config\n version: 1.0.0\n trust: record-missing\n\nAbliteration (abliteration) disabled\n format: openclaw\n source: <checkout>/extensions/abliteration/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: abliteration\n\nAmazon Bedrock (amazon-bedrock) disabled\n format: openclaw\n source: <checkout>/extensions/amazon-bedrock/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: amazon-bedrock\n\nAmazon Bedrock Mantle (amazon-bedrock-mantle) disabled\n format: openclaw\n source: <checkout>/extensions/amazon-bedrock-mantle/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: amazon-bedrock-mantle\n\nAnthropic Vertex (anthropic-vertex) disabled\n format: openclaw\n source: <checkout>/extensions/anthropic-vertex/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: anthropic-vertex\n\n@openclaw/arcee-provider (arcee) disabled\n format: openclaw\n source: <checkout>/extensions/arcee/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: arcee\n\nBaseten (baseten) disabled\n format: openclaw\n source: <workspace>/alix-replace-two-202\n[excerpt; SHA-256 covers full output]", "stdoutSha256": "3134ff465ff14edb4b55594dcadf27443d115ee20439f96f0908fcc3037fd04e", "stderr": "", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "name": "plugin-inspect", "args": [ "plugins", "inspect", "report-plugin" ], "exit": 0, "stdout": "PLUGIN_MARKER\nid: report-plugin\nPLUGIN_DESCRIPTION\n\nStatus: disabled\nFormat: openclaw\nSource: <fixture>/plugin/index.js\nOrigin: config\nTrust: reason=record-missing; registryPath=\"<fixture>/state/state/openclaw.sqlite\"; origin=\"config\"; installSource=null; installSpec=null\nVersion: 1.0.0\nShape: non-capability\nCapability mode: none\n\nReason: plugins disabled\n", "stdoutSha256": "b9c42ca77f4eacdbc4c42c532d4ec478cb9cd7c169763be1ffeb2d220f5b1a76", "stderr": "", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "name": "tainted-plugin-json", "args": [ "plugins", "inspect", "report-plugin", "--json" ], "exit": 0, "stdout": "{\n \"workspaceDir\": \"<fixture>/workspace\",\n \"plugin\": {\n \"id\": \"report-plugin\",\n \"name\": \"PLUGIN_MARKER\\u001b]0;ALIX_CONTROL_PROOF\\u0007�\",\n \"description\": \"PLUGIN_DESCRIPTION\\u001b]0;ALIX_CONTROL_PROOF\\u0007�\",\n \"packageVersion\": \"1.0.0\",\n \"version\": \"1.0.0\",\n \"packageName\": \"report-plugin\",\n \"format\": \"openclaw\",\n \"source\": \"<fixture>/plugin/index.js\",\n \"rootDir\": \"<fixture>/plugin\",\n \"origin\": \"config\",\n \"workspaceDir\": \"<fixture>/workspace\",\n \"trust\": {\n \"reason\": \"record-missing\",\n \"registryPath\": \"<fixture>/state/state/openclaw.sqlite\",\n \"origin\": \"config\"\n },\n \"enabled\": false,\n \"compat\": [],\n \"explicitlyEnabled\": false,\n \"activated\": false,\n \"activationSource\": \"disabled\",\n \"activationReason\": \"plugins disabled\",\n \"syntheticAuthRefs\": [],\n \"status\": \"disabled\",\n \"toolNames\": [],\n \"hookNames\": [],\n \"channelIds\": [],\n \"cliBackendIds\": [],\n \"providerIds\": [],\n \"embeddingProviderIds\": [],\n \"speechProviderIds\": [],\n \"realtimeTranscriptionProviderIds\": [],\n \"realtimeVoiceProviderIds\": [],\n \"mediaUnderstandingProviderIds\": [],\n \"transcriptSourceProviderIds\": [],\n \"imageGenerationProviderIds\": [],\n \"videoGenerationProviderIds\": [],\n \"musicGenerationProviderIds\": [],\n \"webFetchProviderIds\": [],\n \"webSearchProviderIds\": [],\n \"migrationProviderIds\": [],\n \"contextEngineIds\": [],\n \"agentHarnessIds\": [],\n \"cliCommands\": [],\n \"services\": [],\n \"gatewayDiscoveryServi\n[excerpt; SHA-256 covers full output]", "stdoutSha256": "245e23ec0dce85f9f10566a7ee9d2c7268ea0666cb2a417635d166239f60deac", "stderr": "", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "name": "legal-plugin-list-verbose", "args": [ "plugins", "list", "--verbose" ], "exit": 0, "stdout": "Plugins (0/177 enabled)\nTrust is provenance, not a code-safety guarantee.\nPLUGIN_MARKER (report-plugin) disabled\n format: openclaw\n source: <fixture>/plugin/index.js\n origin: config\n version: 1.0.0\n trust: record-missing\n\nAbliteration (abliteration) disabled\n format: openclaw\n source: <checkout>/extensions/abliteration/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: abliteration\n\nAmazon Bedrock (amazon-bedrock) disabled\n format: openclaw\n source: <checkout>/extensions/amazon-bedrock/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: amazon-bedrock\n\nAmazon Bedrock Mantle (amazon-bedrock-mantle) disabled\n format: openclaw\n source: <checkout>/extensions/amazon-bedrock-mantle/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: amazon-bedrock-mantle\n\nAnthropic Vertex (anthropic-vertex) disabled\n format: openclaw\n source: <checkout>/extensions/anthropic-vertex/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: anthropic-vertex\n\n@openclaw/arcee-provider (arcee) disabled\n format: openclaw\n source: <checkout>/extensions/arcee/index.ts\n origin: bundled\n version: 2026.10.7\n trust: bundled\n providers: arcee\n\nBaseten (baseten) disabled\n format: openclaw\n source: <workspace>/alix-replace-two-202\n[excerpt; SHA-256 covers full output]", "stdoutSha256": "3134ff465ff14edb4b55594dcadf27443d115ee20439f96f0908fcc3037fd04e", "stderr": "", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "name": "legal-plugin-inspect", "args": [ "plugins", "inspect", "report-plugin" ], "exit": 0, "stdout": "PLUGIN_MARKER\nid: report-plugin\nPLUGIN_DESCRIPTION\n\nStatus: disabled\nFormat: openclaw\nSource: <fixture>/plugin/index.js\nOrigin: config\nTrust: reason=record-missing; registryPath=\"<fixture>/state/state/openclaw.sqlite\"; origin=\"config\"; installSource=null; installSpec=null\nVersion: 1.0.0\nShape: non-capability\nCapability mode: none\n\nReason: plugins disabled\n", "stdoutSha256": "b9c42ca77f4eacdbc4c42c532d4ec478cb9cd7c169763be1ffeb2d220f5b1a76", "stderr": "", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, { "name": "missing-plugin-human", "args": [ "plugins", "inspect", "missing-plugin\u001b]0;ALIX_CONTROL_PROOF\u0007�\nforged error" ], "exit": 1, "stdout": "", "stdoutSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "stderr": "Plugin not found: missing-plugin\\nforged error. Run `openclaw plugins list` to see installed plugins, or `openclaw plugins search missing-plugin\\nforged error` to look for installable plugins.\n", "stderrSha256": "777bfa2fcfad773ca7330b3dc991b97092e8824fcdbe88fd819b4ce00b682a37" }, { "name": "missing-plugin-json", "args": [ "plugins", "inspect", "missing-plugin\u001b]0;ALIX_CONTROL_PROOF\u0007�\nforged error", "--json" ], "exit": 1, "stdout": "{\n \"ok\": false,\n \"error\": {\n \"type\": \"cli_error\",\n \"message\": \"Plugin not found: missing-plugin\\u001b]0;ALIX_CONTROL_PROOF\\u0007�\\nforged error. Run `openclaw plugins list` to see installed plugins, or `openclaw plugins search missing-plugin\\u001b]0;ALIX_CONTROL_PROOF\\u0007�\\nforged error` to look for installable plugins.\"\n }\n}\n", "stdoutSha256": "b0d201cf9d6182fc6458195a4615046430801eab0a2b841d58adb0c53425825f", "stderr": "", "stderrSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" } ], "cleanup": "All synthetic fixture directories are owned and retained with the receipt; no production state or channels touched." }Earlier evidence (historical SHAs and CI observations)
292cf5f9ef550be6ba89df162f78dde3729143b0.520302d8ee63fd254e88042e96c393d8dc3ec461.pnpm build qaRuntime, Node 26.1.0. Same local plugin fixture and CLI arguments on base and head, with isolated HOME, configuration, state, workspace, and temporary directories. Plugins are disabled; the fixture entrypoint throws if imported.openclaw.mjssubprocesses, installed manifest discovery, and production list/inspect renderers; captured actual stdout, stderr, and exit status. Controls count C0 other than tab/newline/carriage return, plus DEL/C1.node openclaw.mjs plugins list --verbosenode openclaw.mjs plugins inspect report-pluginExact-head GREEN receipt time: 2026-10-15 06:57 UTC; all five CLI subprocesses exited 0.
The production owners exercised were
plugins-list-command.ts,plugins-list-format.ts, andplugins-inspect-command.ts, through metadata-only discovery. This does not claim provider or runtime handler execution.Controls: replacing tainted names/descriptions with ordinary values preserves their human output and produces zero unsafe controls.
plugins inspect report-plugin --jsonretains the exact tainted parsed name while escaping ESC in the serialized output. Command tests additionally exercise the default table, verbose list,inspect --all, trusted status colors, both single/all global diagnostic stderr, and list/inspect raw JSON values.Synthetic manifest and inspectable output
The fixture has a normal package manifest with extension
./index.js, version1.0.0, and an entrypoint that throws if imported. Its directory is an explicit plugin load path;plugins.enabledis false. The installedopenclaw.plugin.jsoncontains:{"id":"report-plugin","name":"PLUGIN_MARKER\u001b]0;ALIX_CONTROL_PROOF\u0007\u009f","description":"PLUGIN_DESCRIPTION\u001b]0;ALIX_CONTROL_PROOF\u0007\u009f","configSchema":{"type":"object","properties":{}}}Escaped excerpts of actual CLI stdout:
The collector records the clean checkout SHA, timestamp, complete subprocess outputs, and numeric observations, and validates the matching clean buildstamp. Collector SHA-256:
77ecf3ee51f7af0ffcbc35d3a41a92abf37edc3dd090c31c415a96c8f20a98a6; its subprocess/isolation helper SHA-256:9618fa1e6e0263e7ce22d485b7c1620a8db3cd0dee2ef11727c0d4253bace8cb. Evidence needed to assess the result is reproduced above.Validation:
pnpm test src/cli/plugins-terminal-format.test.ts --maxWorkers 1: 9/9 passed, exit 0; single-file wall 26.04s (Vitest duration 18.76s).plugins-list-format,plugins-cli.list,plugins-cli.inspect, andplugins-list-route-cold-importssuites: 42/42 passed on the same production patch.Existing-solutions preflight: reuse the canonical terminal sanitizer; all-state semantic/symbol searches and Alix/Leon open-file footprints found no competing fix. Human warning, default/verbose list, single/all inspection, install provenance, and inspection diagnostics are sanitized at their existing owner. Report JSON remains raw; diagnostic console envelopes continue using the existing formatter.
Cleanup: fixtures and captured outputs are retained in owned temporary directories outside the product branch. No production configuration, data, services, or channels were touched.
Not tested: a physical interactive terminal, loaded plugin/provider execution, authenticated external services, and other plugin lifecycle commands. This proves the real CLI byte boundary, not a PTY or runtime execution claim. Broad platform checks remain with PR CI.