Skip to content

security: MCP HTTP transport sets Access-Control-Allow-Origin: * with no Origin validation #50

Description

@jrosskopf

Surfaced while reviewing MCP transports across DataZoo repos (flAPI MCP overhaul, DataZooDE/flapi#107).

src/mcp/mcp_http_server.cpp (~line 75) sets Access-Control-Allow-Origin: * and never validates the Origin header on the POST /mcp transport. This is the DNS-rebinding / CSRF shape the MCP transport spec has warned about since 2025-03-26, and it is more serious here because the endpoint executes writes against a production SAP system (adt_write_source, adt_delete_object, bw_save_object).

Recommended fix (independent of any protocol-version work):

  • Validate Origin against an allowlist; return 403 on mismatch.
  • Default the allowlist to the embedded web UI's origin.

Reference: MCP 2026-07-28 Streamable HTTP transport security section.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions