Skip to content

fix: reject mangled publisher metadata#1310

Merged
rdimitrov merged 2 commits into
modelcontextprotocol:mainfrom
he-yufeng:fix/publisher-unicode-preflight
Jul 12, 2026
Merged

fix: reject mangled publisher metadata#1310
rdimitrov merged 2 commits into
modelcontextprotocol:mainfrom
he-yufeng:fix/publisher-unicode-preflight

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

  • add a publisher preflight that rejects non-UTF-8 server.json bytes before parsing
  • reject unpaired UTF-16 surrogate escapes inside JSON string fields before publish/validate requests are sent
  • keep valid non-ASCII descriptions, including em dashes, round-tripping through the publish path
  • make the publisher test token helper set USERPROFILE as well as HOME so Windows tests use the temp home directory

Closes #1306.

To verify

  • go test ./cmd/publisher/commands -run "TestPublishCommand_(Success|PreservesNonASCIIDescription|RejectsInvalidUTF8ServerJSON|RejectsUnpairedSurrogateEscape)$" -count=1
  • go test ./cmd/publisher/commands -run TestPublishCommand -count=1
  • go test ./cmd/publisher/commands -run TestValidateCommand -count=1
  • git diff --check

@he-yufeng
he-yufeng force-pushed the fix/publisher-unicode-preflight branch from 48c86a5 to fa7691f Compare May 27, 2026 21:31
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Follow-up: fixed the CI lint failure from the first push. The test helper no longer returns an unused path, and local golangci-lint v2.11.4 run ./cmd/publisher/commands/... now reports 0 issues. Targeted publisher tests still pass.

@he-yufeng
he-yufeng force-pushed the fix/publisher-unicode-preflight branch from fa7691f to e21f214 Compare June 5, 2026 01:55

@rdimitrov rdimitrov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, @he-yufeng, sorry for the delay in reviewing it! This addresses a genuine problem so thank you so much for the contribution! 🙏

@rdimitrov
rdimitrov merged commit c36b521 into modelcontextprotocol:main Jul 12, 2026
3 checks passed
rdimitrov added a commit that referenced this pull request Jul 13, 2026
Promotes production to the
[`v1.8.0`](https://github.com/modelcontextprotocol/registry/releases/tag/v1.8.0)
release.

- `deploy/Pulumi.gcpProd.yaml` → `imageTag: 1.8.0` (one line).
- The release build for `v1.8.0` completed successfully, so the image is
present in ghcr.
- **Merging this triggers `deploy-production.yml`** (it's path-filtered
to `deploy/Pulumi.gcpProd.yaml`); the PR itself doesn't deploy.

### Notable behavior changes in v1.8.0
- **Org-namespace publishing now requires org Owner** (via GitHub login
/ PAT). Member-level publishers lose org publish — intended tightening.
- Stricter validation may reject some previously-accepted package
metadata / names (#1310, #1331, #1411).
- New: cargo (crates.io) package registry support (#1207).

### After merge
- Confirm prod `/v0/version` reports `1.8.0` before treating the rollout
as done.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp-publisher mangles non-ASCII description bytes on Windows (em-dash → \udc94 lone surrogate)

2 participants