Skip to content

fix(docs-mcp): hide internal exception details from HTTP clients - #39

Merged
thecompez merged 1 commit into
mainfrom
audit/docs-mcp-error-sanitization-20261009
Oct 9, 2026
Merged

thecompez merged 1 commit into
mainfrom
audit/docs-mcp-error-sanitization-20261009

Conversation

@thecompez

Copy link
Copy Markdown
Member

Summary

  • Replace public 500 responses containing exception messages with a stable {error: internal_error} envelope.
  • Log a structured diagnostic event with only the error class, not the potentially sensitive message.
  • Keep the change in the single source server.mjs file to preserve simple deployment setups.

Evidence

  • The original live error response disclosed the detail Invalid URL for a malformed Host request.
  • The equivalent patched server was tested in isolation; the same malformed request returned only {error: internal_error}, while health and MCP requests still succeeded.
  • node --check and git diff --check succeeded.
  • No production restart or deploy. Live on-disk server was already patched defensively, but running Node process still uses its previous loaded code until controlled restart.

Safety

This is independent of unshipped rate-limiter changes and does not alter healthy request routing.

@thecompez
thecompez marked this pull request as ready for review October 9, 2026 06:01
@thecompez
thecompez merged commit 256f970 into main Oct 9, 2026
3 checks passed
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.

1 participant