Vulnerabilities in pkg:golang/github.com/centrifugal/centrifugo

PACKAGE
Advisory Identifier: GHSA-9468-v6mj-fppw
Advisory Summary

CVE-2026-71485 is a CRITICAL (CVSS 9.1) client-forgeable headers emulation lets any vulnerability (CWE-290: Authentication Bypass by Spoofing) affecting Centrifugo libraries in the Go ecosystem. The issue involves client-forgeable headers emulation lets any client spoof headers forwarded to proxy backends. Remediation is available by upgrading affected packages to version 6.9.0.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/centrifugal/centrifugo

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/centrifugal/centrifugo. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-9468-v6mj-fppw CVE-2026-71485 CRITICAL Centrifugo: Client-forgeable headers emulation lets any client spoof headers forwarded to proxy backends
GHSA-g6vg-wj8f-48cj CVE-2026-49998 HIGH Centrifugo's dynamic JWKS key cache keyed only by `kid` allows cross-issuer JWT authentication bypass
GHSA-q926-c743-49qj - LOW Centrifugo's InsecureSkipTokenSignatureVerify flag silently disables JWT verification with no warning
GHSA-j77h-rr39-c552 CVE-2026-32301 CRITICAL Centrifugo: SSRF via unverified JWT claims interpolated into dynamic JWKS endpoint URL

CVE-2026-71485 at a Glance

CVE Identifier CVE-2026-71485
GHSA Identifier GHSA-9468-v6mj-fppw
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-290: Authentication Bypass by Spoofing
Affected Product Centrifugo
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-71485

To remediate this vulnerability, upgrade all affected Centrifugo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/centrifugal/centrifugo fixed: 6.9.0
Upgrade github.com/centrifugal/centrifugo to 6.9.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/centrifugal/centrifugo

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-71485, inspect your project dependencies for Centrifugo:

inspect dependencies for github.com/centrifugal/centrifugo

Analyze the terminal output to locate any version of Centrifugo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.9.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-290: Authentication Bypass by Spoofing, where this attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks. In Centrifugo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Vulnerability Details **File**: `internal/client/handler.go` (`OnClientConnecting`), `internal/proxy/http.go` (`requestHeaders`), `internal/proxy/grpc.go` (`requestMetadata`), `internal/unigrpc/grpc.go` (`Consume`) **Line**: handler.go:389,548-552 (`e.Headers` -> `SetEmulatedHeadersToContext`), http.go:131-165 (`requestHeaders`), grpc.go:82-114 (`requestMetadata`), unigrpc/grpc.go:46 (`Headers: req.Headers`) ### Root Cause The `http_headers` / `grpc_metadata` proxy config options are documented as "List of incoming HTTP header names to forward to the proxy backend" / "List of incoming gRPC metadata keys to forward to the proxy backend" -- implying the value originates from the underlying transport connection (e.g. set by a trusted reverse proxy/API gateway in front of Centrifugo). Operators commonly use this to forward identity/trust headers to their own backend for access-control decisions. However, the wire protocol used by every Centrifugo transport (`protocol.ConnectRequest`, field `headers`) includes a `headers` map populated entirely from the connecting client's own message (its JSON `connect` command, or for gRPC, its `ConnectRequest` protobuf field) -- not from real transport-level HTTP headers. Centrifugo copies this client-supplied map verbatim into `ConnectEvent.Headers`, then into an "emulated headers" context value used by every proxy type (connect, refresh, subscribe, publish, rpc, sub_refresh, map_publish, map_remove, shared_poll_refresh) for the entire connection lifetime. Any header name in the operator's allowlist is forwarded to the backend with the client's own chosen value, unless a header of the exact same name also happens to be present on the genuine underlying HTTP request. For the unidirectional gRPC transport specifically there is no HTTP request at all, so there is no possible override -- the client-controlled value always wins. ### Attack Scenario 1. Operator configures a connect proxy with `http_headers: ["x-trusted-user"]` (or any header name their backend uses for caller identity/trust). 2. Attacker connects directly to Centrifugo and sends a connect command containing `"headers": {"x-trusted-user": "<any value>"}`. 3. Centrifugo forwards `X-Trusted-User: <attacker value>` to the backend exactly as if a trusted intermediary had set it. 4. The backend, trusting this header per its own design, grants whatever access/identity it associates with that value. ### Impact Full spoofing of any header value the backend trusts for authentication/authorization, for every proxy call type, for the lifetime of the connection -- up to full account/identity impersonation depending on backend logic. No credentials, JWT, or API key required. ### Vulnerable Code ```go // internal/proxy/http.go func requestHeaders(ctx context.Context, allowedHeaders, allowedMetaKeys []string, staticHeaders map[string]string) http.Header { headers := http.Header{} for k, v := range staticHeaders { headers.Set(k, v) } emulatedHeaders, _ := clientcontext.GetEmulatedHeadersFromContext(ctx) // 100% client-controlled for k, v := range emulatedHeaders { if slices.Contains(allowedHeaders, strings.ToLower(k)) { headers.Set(k, v) // forwarded to backend as a real outgoing HTTP header } } httpHeaders, hasHTTPHeaders := middleware.GetHeadersFromContext(ctx) // real headers, if present for k, vv := range httpHeaders { if slices.Contains(allowedHeaders, strings.ToLower(k)) { headers[k] = vv // only overrides if SAME header name was ALSO on the real request } } ... } ``` ```go // internal/unigrpc/grpc.go -- never goes through HTTP middleware, no competing real-header check at all connectRequest := &protocol.ConnectRequest{ Token: req.Token, Data: req.Data, Name: req.Name, Version: req.Version, Headers: req.Headers, // the gRPC client's own protobuf field } ``` ### Recommended Fix Document explicitly that `http_headers`/`grpc_metadata` values can also be supplied by the connecting client itself via "headers emulation" and are not guaranteed to come from a trusted reverse proxy. Provide a separate allowlist (e.g. `trusted_http_headers`) populated only from genuine transport-level HTTP headers, never from client-supplied `ConnectRequest.headers`, for operators who need an unforgeable header. For uniGRPC, consider disabling `http_headers` forwarding entirely since there is no transport-level header concept to fall back on. ### Verification Dynamically confirmed against the official `centrifugo/centrifugo:v6.8.3` Docker image on BOTH the bidirectional WebSocket transport and the unidirectional gRPC transport, using a minimal backend that logs every header it receives: - WS: connecting with `{"connect": {"headers": {"x-trusted-user": "admin-impersonation-via-headers-emulation"}}}` resulted in the backend receiving `X-Trusted-User: admin-impersonation-via-headers-emulation`, despite no such header existing on the real WebSocket upgrade HTTP request. - uniGRPC: calling the `Consume` RPC with `ConnectRequest(headers={"x-trusted-user": "admin-impersonation-via-unigrpc"})` (zero real gRPC metadata set) resulted in the backend receiving `X-Trusted-User: admin-impersonation-via-unigrpc`. - Control tests (no `headers` field / no metadata) confirmed the header is absent from the backend's request in the baseline case.

CVE-2026-71485 Affected Centrifugo Versions

1 component(s)
Fixed Versions:
6.9.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/centrifugal/centrifugo
Go
< 6.9.0
6.9.0

References

Frequently Asked Questions

What is CVE-2026-71485?
CVE-2026-71485 is a security vulnerability in Centrifugo involving Client-forgeable headers emulation lets any client spoof headers forwarded to proxy backends under CWE-290: Authentication Bypass by Spoofing.
Which Centrifugo versions are affected?
Affected versions include releases prior to 6.9.0 across affected packages: github.com/centrifugal/centrifugo.
What version fixes CVE-2026-71485?
Upgrading to 6.9.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/centrifugal/centrifugo affected?
Yes, github.com/centrifugal/centrifugo is affected in releases prior to 6.9.0. Upgrade your dependency to 6.9.0 or later.
What is the CVSS score of CVE-2026-71485?
CVE-2026-71485 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-71485?
CVE-2026-71485 is classified under CWE-290: Authentication Bypass by Spoofing (This attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks.).
How can I check Go dependencies for CVE-2026-71485?
Run the dependency tree command: 'inspect dependencies for github.com/centrifugal/centrifugo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9468-v6mj-fppw",
  "modified" : "2026-09-17T16:35:33Z",
  "published" : "2026-09-02T23:41:37Z",
  "aliases" : [ "CVE-2026-71485" ],
  "summary" : "Centrifugo: Client-forgeable headers emulation lets any client spoof headers forwarded to proxy backends",
  "details" : "## Vulnerability Details\n\n**File**: `internal/client/handler.go` (`OnClientConnecting`), `internal/proxy/http.go` (`requestHeaders`), `internal/proxy/grpc.go` (`requestMetadata`), `internal/unigrpc/grpc.go` (`Consume`)\n**Line**: handler.go:389,548-552 (`e.Headers` -> `SetEmulatedHeadersToContext`), http.go:131-165 (`requestHeaders`), grpc.go:82-114 (`requestMetadata`), unigrpc/grpc.go:46 (`Headers: req.Headers`)\n\n### Root Cause\nThe `http_headers` / `grpc_metadata` proxy config options are documented as \"List of incoming HTTP header names to forward to the proxy backend\" / \"List of incoming gRPC metadata keys to forward to the proxy backend\" -- implying the value originates from the underlying transport connection (e.g. set by a trusted reverse proxy/API gateway in front of Centrifugo). Operators commonly use this to forward identity/trust headers to their own backend for access-control decisions.\n\nHowever, the wire protocol used by every Centrifugo transport (`protocol.ConnectRequest`, field `headers`) includes a `headers` map populated entirely from the connecting client's own message (its JSON `connect` command, or for gRPC, its `ConnectRequest` protobuf field) -- not from real transport-level HTTP headers. Centrifugo copies this client-supplied map verbatim into `ConnectEvent.Headers`, then into an \"emulated headers\" context value used by every proxy type (connect, refresh, subscribe, publish, rpc, sub_refresh, map_publish, map_remove, shared_poll_refresh) for the entire connection lifetime. Any header name in the operator's allowlist is forwarded to the backend with the client's own chosen value, unless a header of the exact same name also happens to be present on the genuine underlying HTTP request. For the unidirectional gRPC transport specifically there is no HTTP request at all, so there is no possible override -- the client-controlled value always wins.\n\n### Attack Scenario\n1. Operator configures a connect proxy with `http_headers: [\"x-trusted-user\"]` (or any header name their backend uses for caller identity/trust).\n2. Attacker connects directly to Centrifugo and sends a connect command containing `\"headers\": {\"x-trusted-user\": \"<any value>\"}`.\n3. Centrifugo forwards `X-Trusted-User: <attacker value>` to the backend exactly as if a trusted intermediary had set it.\n4. The backend, trusting this header per its own design, grants whatever access/identity it associates with that value.\n\n### Impact\nFull spoofing of any header value the backend trusts for authentication/authorization, for every proxy call type, for the lifetime of the connection -- up to full account/identity impersonation depending on backend logic. No credentials, JWT, or API key required.\n\n### Vulnerable Code\n```go\n// internal/proxy/http.go\nfunc requestHeaders(ctx context.Context, allowedHeaders, allowedMetaKeys []string, staticHeaders map[string]string) http.Header {\n    headers := http.Header{}\n    for k, v := range staticHeaders { headers.Set(k, v) }\n    emulatedHeaders, _ := clientcontext.GetEmulatedHeadersFromContext(ctx) // 100% client-controlled\n    for k, v := range emulatedHeaders {\n        if slices.Contains(allowedHeaders, strings.ToLower(k)) {\n            headers.Set(k, v) // forwarded to backend as a real outgoing HTTP header\n        }\n    }\n    httpHeaders, hasHTTPHeaders := middleware.GetHeadersFromContext(ctx) // real headers, if present\n    for k, vv := range httpHeaders {\n        if slices.Contains(allowedHeaders, strings.ToLower(k)) {\n            headers[k] = vv // only overrides if SAME header name was ALSO on the real request\n        }\n    }\n    ...\n}\n```\n```go\n// internal/unigrpc/grpc.go -- never goes through HTTP middleware, no competing real-header check at all\nconnectRequest := &protocol.ConnectRequest{\n    Token: req.Token, Data: req.Data, Name: req.Name, Version: req.Version,\n    Headers: req.Headers, // the gRPC client's own protobuf field\n}\n```\n\n### Recommended Fix\nDocument explicitly that `http_headers`/`grpc_metadata` values can also be supplied by the connecting client itself via \"headers emulation\" and are not guaranteed to come from a trusted reverse proxy. Provide a separate allowlist (e.g. `trusted_http_headers`) populated only from genuine transport-level HTTP headers, never from client-supplied `ConnectRequest.headers`, for operators who need an unforgeable header. For uniGRPC, consider disabling `http_headers` forwarding entirely since there is no transport-level header concept to fall back on.\n\n### Verification\nDynamically confirmed against the official `centrifugo/centrifugo:v6.8.3` Docker image on BOTH the bidirectional WebSocket transport and the unidirectional gRPC transport, using a minimal backend that logs every header it receives:\n- WS: connecting with `{\"connect\": {\"headers\": {\"x-trusted-user\": \"admin-impersonation-via-headers-emulation\"}}}` resulted in the backend receiving `X-Trusted-User: admin-impersonation-via-headers-emulation`, despite no such header existing on the real WebSocket upgrade HTTP request.\n- uniGRPC: calling the `Consume` RPC with `ConnectRequest(headers={\"x-trusted-user\": \"admin-impersonation-via-unigrpc\"})` (zero real gRPC metadata set) resulted in the backend receiving `X-Trusted-User: admin-impersonation-via-unigrpc`.\n- Control tests (no `headers` field / no metadata) confirmed the header is absent from the backend's request in the baseline case.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/centrifugal/centrifugo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.9.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.8.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/centrifugal/centrifugo/security/advisories/GHSA-9468-v6mj-fppw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-71485"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/centrifugal/centrifugo/pull/1182"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/centrifugal/centrifugo/commit/84d38cea1dd2efa24375a148817a974c8727f4b0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/centrifugal/centrifugo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/centrifugal/centrifugo/releases/tag/v6.9.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-290" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-02T23:41:37Z",
    "nvd_published_at" : "2026-08-20T21:17:08Z"
  }
}