Repository navigation
Conversation
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Review finding (P2): sanitizeCell(s, 0) and sanitizeDescriptionCell(s, 0) go through detect.CapEvidence, which always caps at 200 runes, so `catalog search`/`catalog show` cut the catalog ID that `catalog add` must match exactly and could hide the tail of an install command. Escape control/format runes with dedicated helpers that do not cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verified the bug on main and the fix; thank you! The review found one gap, so I pushed a small maintainer commit on top of your branch: I will merge once CI is green. |
Dumbris
left a comment
There was a problem hiding this comment.
Verified: the bug reproduces on main and the PR fixes it. The review found one gap, closed by the maintainer commit on top (regression test included). Race tests and CI lint for the touched packages are clean on this branch merged with main, and the result was cross-reviewed clean.
|
The remaining binary-build failure on current head Failed macOS arm64 job. I attempted to rerun the failed jobs, but GitHub denied the request ( |
|
Merged. Thank you, @rudycelekli! Contributions like this are what keep MCPProxy moving, and they matter a lot to the project. One small ask, only if you feel like it: a short public note about your change (a tweet, a LinkedIn post, a line in a community you are part of) helps more people discover MCPProxy. No pressure at all, and I would be glad to repost it. |
Bug
mcpproxy catalog searchandmcpproxy catalog showprint registry-supplied strings (title, id, publisher, description, install command, required input names) straight to the terminal. The search table only byte-truncates the title, andshowprints everything with%s.These strings come from remote registries (the official registry, Smithery, custom
registriesentries). An entry whose title or description contains ANSI escapes can clear or rewrite the operator's screen. A newline can forge extra table rows next to a real result, for example a fake✓ addedline.mcpproxy tools listalready escapes upstream-controlled text for this reason, usingsanitizeCell/sanitizeDescriptionCellanddetect.CapEvidence(GH #938). The catalog commands never got the same treatment.Trigger
A registry entry with this title:
Running
mcpproxy catalog search <q>ormcpproxy catalog show official/<id>writes the raw ESC sequences to the tty.Fix
Run the registry-supplied fields through the existing helpers:
sanitizeDescriptionCellfor prose (the title, which keeps the 40-rune cap, and the description).sanitizeCellfor identifiers (id, publisher, transport, install URL and command, input names).Control and format runes are escaped (made visible), not dropped. JSON/YAML output is unchanged.
Test
TestCatalogOutput_EscapesRegistryControlCharactersrenders a poisoned result throughprintCatalogTableandrenderCatalogShowand asserts that neither output contains a raw ESC byte.Commands run
go vet ./cmd/mcpproxy: cleango test -count=1 ./cmd/mcpproxy: ok (cgo build, run locally withSDKROOTset to the macOS 26.5 SDK)git stashofcatalog_cmd.go), the new test fails withsearch table wrote a raw ESC to the terminalandshow wrote a raw ESC to the terminal.gofmt -lon the edited files: no output