/

CVE-2026-53840

Severity:

HIGH RISK

(7.1)

Sensitive Header Exposure (CWE-522) in OpenClaw MCP

CVE-2026-53840

Analyzed

Vulnerability type

Category:

Sensitive Information Exposure

CWE:

CWE-522

Impact:

Exposure of Authentication and Routing Secrets

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenClaw's streamable-http MCP servers may leak operator-configured custom headers by forwarding them during cross-origin redirects.

If an attacker controls or compromises an MCP endpoint, they can trigger redirects that exfiltrate sensitive headers such as API keys or tenant-routing tokens to attacker-controlled origins.

Affected context

This vulnerability appears in OpenClaw deployments using streamable-http MCP servers where:

  • Operators configure custom HTTP headers for backend or tenant routing
  • MCP endpoints are allowed to issue HTTP redirects, including cross-origin redirects
  • Downstream clients or infrastructure follow redirects automatically

The risk is most pronounced when these headers carry secrets such as API keys, bearer tokens, or internal routing identifiers that are intended only for trusted origins.

Exploit preconditions

  • Attack surface: Streamable-http MCP endpoints that accept or broker HTTP requests
  • Required access: Ability to control or compromise an MCP endpoint or response path (e.g., run a malicious MCP service or inject redirect responses)
  • Trigger point: Issuing an HTTP redirect (e.g., 302, 307) to an attacker-controlled domain while the server forwards operator-configured headers
  • Why exploitation is possible: The MCP server does not differentiate between same-origin and cross-origin redirects when forwarding custom headers, causing sensitive headers to be sent to untrusted destinations

Why this happens

The core issue is improper handling of sensitive headers in the presence of redirects.

OpenClaw's streamable-http MCP servers forward operator-configured custom headers blindly, including across origin boundaries, instead of scoping them to intended targets or stripping them on redirects.

This maps to CWE-522: Insufficiently Protected Credentials, because secrets placed in HTTP headers are not adequately constrained or protected from unintended exposure when redirects occur.

Potential impact

  • Leakage of API keys, bearer tokens, or other authentication credentials to attacker-controlled origins
  • Exposure of tenant-routing or internal routing headers that could enable cross-tenant data access
  • Facilitation of account takeover or service impersonation if stolen credentials are reusable
  • Increased blast radius if exposed headers grant access to downstream services or internal control planes

General mitigation guidance

Mitigation generally centers around scoping and sanitizing sensitive headers and reducing implicit trust in redirect behavior.

Useful defensive patterns include:

  • Limiting which headers are ever treated as secrets and avoiding long-lived credentials in custom headers
  • Stripping or selectively forwarding custom headers on redirects, especially when the redirect crosses origins or trust boundaries
  • Binding headers that carry secrets to specific hosts, schemes, or paths and dropping them when the target changes
  • Using short-lived, least-privilege tokens rather than static API keys for MCP communication
  • Enforcing explicit allowlists for outbound destinations from MCP servers to reduce exfiltration paths

How teams detect issues like this

Detection approaches can focus on both configuration and runtime behavior:

  • Reviewing MCP server configurations for headers that contain secrets or tokens and verifying how they behave on redirects
  • Using static analysis or policy-as-code checks to flag code paths that forward headers during redirects without origin checks
  • Instrumenting HTTP logs to capture redirect chains and identify cases where sensitive headers are sent to unfamiliar or external domains
  • Employing security scanners or automated tests that simulate malicious MCP endpoints issuing redirects and verifying whether secrets are exposed

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-rjxq-qqhf-8hwh
vulncheck.comvulncheck.com/advisories/openclaw-custom-header-leakage-via-mcp-streamable-http-cross-origin-redirects

Frequently asked

questions

Exploitation requires control over or compromise of an MCP endpoint or response chain. Once an attacker can issue redirects through that endpoint, they can potentially exfiltrate sensitive headers to their own infrastructure.

The attacker needs the ability to influence responses from an MCP service—either by running a malicious MCP service, compromising an existing one, or otherwise injecting redirect responses. They do not necessarily need direct access to OpenClaw's core components if they can control an endpoint used by the MCP server.

The safest pattern is to ensure sensitive headers are never forwarded indiscriminately: strip or selectively forward them on redirects, constrain them to specific trusted destinations, and avoid embedding high-value secrets in headers where possible.

Adopting a defense-in-depth approach helps: treat credentials as highly scoped, avoid long-lived secrets, implement origin-aware redirect handling that drops sensitive headers on cross-origin redirects, and enforce configuration and code review policies that scrutinize any logic that forwards headers across trust boundaries.

Find out what's already
exploitable in your codebase.