Skip to content

Drop build fingerprint from proxy /health response - #6280

Merged
Nashon-Steffen merged 1 commit into
mainfrom
finding-f-health-fingerprint
Aug 10, 2026
Merged

Drop build fingerprint from proxy /health response#6280
Nashon-Steffen merged 1 commit into
mainfrom
finding-f-health-fingerprint

Conversation

@Nashon-Steffen

Copy link
Copy Markdown
Contributor

Summary

The proxy /health endpoint (pkg/healthcheck/healthcheck.go) set Version: versions.GetVersionInfo() on its response unconditionally — no flag, no redaction — exposing version, commit, build date, runtime.Version(), and GOOS/GOARCH. The endpoint must stay unauthenticated so Kubernetes liveness/readiness probes can reach it, so the fix is not "put /health behind auth" — it is to stop disclosing the build fingerprint.

ToolHive already made this call twice, and the proxies simply did not follow it:

  • pkg/vmcp/server/server.go returns only {"status":"ok"}, with a security comment that it exposes no version information to prevent disclosure.
  • pkg/api/v1/healthcheck.go returns 204 No Content.

This is Finding F of #6271.

  • Remove the Version field from HealthResponse and stop calling versions.GetVersionInfo(), so the unauthenticated body carries no version, commit, build date, Go version, or platform.
  • Keep status, transport, and MCP backend status so probes retain the degraded-state signal (/health still returns 503 when unhealthy).
  • Aligns the proxies with the minimal shape already used by vMCP and the v1 API.

Part of #6271

Type of change

  • Bug fix

Test plan

  • Unit tests (task test)
  • Linting (task lint-fix)

Updated pkg/healthcheck/healthcheck_test.go: dropped the Version assertions and added assertNoFingerprint, which asserts the serialized /health body contains none of version, commit, build_date, go_version, platform.

API Compatibility

  • This PR does not break the v1beta1 API, OR the api-break-allowed label is applied and the migration guidance is described above.

Does this introduce a user-facing change?

Yes. The proxy /health JSON response no longer includes a version object (version/commit/build date/Go version/platform). Anyone parsing that field from /health should read version information from an authenticated source instead.

Generated with Claude Code

The proxy /health endpoint must stay unauthenticated so Kubernetes
liveness and readiness probes can reach it, but it returned a full build
fingerprint — version, commit, build date, Go runtime version, and
GOOS/GOARCH — with no flag and no redaction. ToolHive already made the
opposite call in the vMCP server (returns only {"status":"ok"}) and the
v1 API (204 No Content), both with security comments about not disclosing
version information on an unauthenticated path. The proxies did not follow
that decision.

Remove the Version field from HealthResponse so the unauthenticated body
carries no build fingerprint, aligning the proxies with vMCP and the v1
API. Status, transport, and MCP backend status remain so probes keep the
degraded-state signal.

Part of #6271

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Nashon-Steffen
Nashon-Steffen requested a review from JAORMX as a code owner August 10, 2026 21:49
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.77%. Comparing base (5c3bafb) to head (cc6e693).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6280      +/-   ##
==========================================
+ Coverage   72.75%   72.77%   +0.01%     
==========================================
  Files         742      742              
  Lines       77325    77324       -1     
==========================================
+ Hits        56258    56270      +12     
+ Misses      17107    17076      -31     
- Partials     3960     3978      +18     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants