Repository navigation
fix(plugins): sanitize registry package fields in the search report - #175160
Closed
wangmiao0668000666 wants to merge 1 commit into
Closed
wangmiao0668000666 wants to merge 1 commit into
wangmiao0668000666 wants to merge 1 commit into
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, headafe7583e983e; 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 evilevil]0;xSEARCH_NAME_MARKER code-plugin | official | v1.0.0 — desc]0;ySEARCH_SUMMARY_MARKERevilSEARCH_NAME_MARKER code-plugin | official | v1.0.0 — descSEARCH_SUMMARY_MARKERInstall:hintopenclaw plugins install evil]0;xSEARCH_NAME_MARKERopenclaw plugins install evilSEARCH_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).