---
summary: Security hardening — fail-closed Origin guard (loopback-only default), validated landing-page bearer check, raw-payload logging removed, opt-in LLM transcripts
breaking: false
---

# 0.7.1 — 2026-04-24

Security hardening triggered by the [0.6.17 security review](https://github.com/cyanheads/mcp-ts-core/issues). Closes three fail-open defaults in the HTTP transport and default log pipeline. No runtime API breaks — `createLandingPageHandler` gained an optional second parameter; all other surfaces are unchanged.

## Fixed

- **HTTP Origin guard now fails closed for remote browser origins ([#63](https://github.com/cyanheads/mcp-ts-core/issues/63))** — when `MCP_ALLOWED_ORIGINS` is unset, the Origin guard at `src/mcp-server/transports/http/httpTransport.ts` falls back to loopback-only (`localhost`, `127.0.0.1`, `[::1]`, with optional port) instead of accepting any Origin. CORS stays wildcard by default so non-browser CLI clients (no `Origin` header) are unaffected. Explicit `MCP_ALLOWED_ORIGINS='*'` is now an opt-in to disable Origin validation entirely. Previous behavior combined wildcard CORS with a wildcard Origin check, so an unauthenticated dev server accepted cross-origin browser POSTs from arbitrary hosts.
- **Landing page `requireAuth` validates the bearer token ([#62](https://github.com/cyanheads/mcp-ts-core/issues/62))** — `createLandingPageHandler(manifest, authStrategy?)` now calls `authStrategy.verify(token)` when `landing.requireAuth=true`, using the same strategy and the same `startsWith('Bearer ') + substring(7)` extraction pattern as `authMiddleware`. Missing, malformed, or invalid tokens produce the degraded page. When `requireAuth=true` without a configured auth strategy (`MCP_AUTH_MODE=none`), every caller gets the degraded view and a startup warning explains how to fix it. Previous behavior unlocked the full inventory on any nonempty `Authorization` header.
- **Default logs no longer persist raw caller payloads ([#61](https://github.com/cyanheads/mcp-ts-core/issues/61))** — `toolHandlerFactory.ts` and `resourceHandlerFactory.ts` no longer inject raw `input` / `inputParams` into the `RequestContext`, so the completion log's `...context` spread in `performance.ts` has nothing sensitive to leak. Raw `input` is also removed from the `ErrorHandler.handleError` call in the tool factory. Input size and parameter names remain visible as OTel metric attributes.

## Added

- **`LOG_LLM_INTERACTIONS` env var ([#61](https://github.com/cyanheads/mcp-ts-core/issues/61))** — new config key `logLlmInteractions` (default `false`). The OpenRouter provider emits metadata-only interaction logs by default (model, message count, streaming flag, generation params, token usage, finish reasons, chunk count). Full request/response transcripts are persisted to `interactions.log` only when the operator explicitly opts in — persisting user messages and model completions is a data-handling decision, not a default.

## Changed

- **Auth strategy created once in `httpTransport.ts`** — the single `createAuthStrategy()` call now runs before the landing-page mount and is shared with the MCP endpoint's auth middleware. Both surfaces verify bearer tokens through the same strategy instance.
