/

CVE-2026-32913

Severity:

CRITICAL RISK

(9.3)

Improper Protection of Credentials in OpenClaw

CVE-2026-32913

Analyzed

Vulnerability type

Category:

Improper Protection of Credentials

CWE:

CWE-522

Impact:

Exposure of Authentication Tokens and API Keys via Cross-Origin Redirects

Severity:

CRITICAL RISK

(9.3)

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 fetchWithSsrFGuard function improperly forwards custom authorization headers (such as X-Api-Key and Private-Token) across cross-origin redirects.

When a request is redirected to a different origin, these sensitive headers may be sent to an attacker-controlled endpoint, exposing secrets intended only for the original destination.

Affected context

This vulnerability occurs in OpenClaw deployments that:

  • Use fetchWithSsrFGuard to issue HTTP requests that include sensitive custom headers (e.g., X-Api-Key, Private-Token, or similar secrets)
  • Allow the initial target endpoint to respond with HTTP redirects (3xx) to arbitrary locations
  • Do not constrain or sanitize the forwarding of authorization-related headers when the redirect crosses origin boundaries

The issue is most critical when the redirected location can be influenced or controlled by an attacker, enabling them to receive headers that should remain confined to the original trusted service.

Exploit preconditions

  • Attack surface: Server-side or backend HTTP requests made through fetchWithSsrFGuard
  • Required access: Ability to:
  • Control or influence the redirect target of an HTTP 3xx response, or
  • Operate a service that OpenClaw will request and follow redirects from
  • Trigger point: A fetchWithSsrFGuard call that:
  • Sends sensitive headers to an initial origin, and
  • Follows an HTTP redirect to a different origin while still forwarding those headers
  • Why exploitation is possible: The implementation does not enforce origin checks or header stripping on cross-origin redirects, so secrets attached to the original request are automatically forwarded to the new, potentially malicious origin.

Why this happens

The underlying bug is a failure to properly protect sensitive credentials during HTTP redirection.

fetchWithSsrFGuard attaches authorization-like headers to outgoing requests and continues to send them on all subsequent redirect hops, regardless of changes in origin.

This maps to CWE-522: Insufficiently Protected Credentials, where sensitive tokens are handled without appropriate contextual safeguards such as origin scoping, header filtering, or redirect-aware policies.

In abstract terms, the component incorrectly assumes that redirects are trustworthy and that headers suitable for one origin remain safe when the request transparently moves to another, breaking the trust boundary around those credentials.

Potential impact

  • Exposure of API keys, private tokens, or other authorization headers to attacker-controlled domains
  • Unauthorized access to protected APIs using leaked credentials
  • Account takeover or impersonation of backend services relying on the compromised tokens
  • Lateral movement into internal systems that trust the leaked credentials
  • Data exfiltration from services accessed with the stolen tokens

General mitigation guidance

Effective mitigation focuses on constraining where sensitive headers are sent and how redirects are handled:

  • Limit authorization-like headers to a narrowly defined set of trusted origins; avoid attaching them to generic or user-influenced URLs.
  • Strip or withhold sensitive headers on cross-origin redirects, only allowing them to propagate when the redirect target matches the original origin or a pre-approved list.
  • Introduce redirect policies that distinguish between same-origin and cross-origin redirects, failing closed for untrusted locations.
  • Centralize credential handling so that tokens are added as close as possible to the final, validated destination rather than at the start of a redirect chain.
  • Apply the principle of least privilege when issuing and scoping API keys and tokens, reducing their power if they are ever exposed.

How teams detect issues like this

Detection efforts can focus on both code behavior and runtime signals:

  • Static analysis and code review:
  • Search for wrapper functions (like fetchWithSsrFGuard) that attach sensitive headers and automatically follow redirects.
  • Flag logic that forwards authorization-related headers without validating the redirect target's origin.
  • Review HTTP client configurations for unrestricted redirect-following combined with credentialed requests.
  • Runtime and policy enforcement:
  • Inspect outbound traffic logs to identify sensitive headers being sent to unexpected or untrusted domains.
  • Use HTTP proxies or gateways to enforce policies that block or scrub authorization headers on cross-origin redirects.
  • Integrate automated security review tools that highlight unsafe redirect + credential patterns as part of CI/CD pipelines.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/46715371b0612a6f9114dffd1466941ac476cef5
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-6mgf-v5j7-45cr
vulncheck.comvulncheck.com/advisories/openclaw-mar-custom-authorization-header-leakage-via-cross-origin-redirects

Frequently asked

questions

Yes. If an attacker can control or influence redirect targets, or operate an endpoint that OpenClaw contacts with sensitive headers, they can remotely trigger cross-origin redirects that expose those headers.

An attacker typically needs the ability to control the destination of a redirect in a workflow that uses fetchWithSsrFGuard, or to host a service that OpenClaw will call with credentials attached. They do not need direct access to the OpenClaw server itself.

The safest pattern is to never forward sensitive headers across origin boundaries: strip authorization-like headers on cross-origin redirects, and only attach them to requests whose final destination is a known, trusted origin.

Establish a consistent policy for credential handling in HTTP clients: scope secrets to specific origins, treat redirects as changes in trust boundaries, enforce header filtering for cross-origin traffic, and include these rules in code review checklists and automated tests.

Find out what's already
exploitable in your codebase.