/

CVE-2026-32301

Severity:

CRITICAL RISK

(9.3)

SSRF in Centrifugo Dynamic JWKS Endpoint Resolution

CVE-2026-32301

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Server-Side Request Forgery leading to potential internal network access and data exfiltration

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

Centrifugo's dynamic JWKS URL handling can be abused to perform Server-Side Request Forgery (SSRF) when template variables are derived from untrusted JWT claims.

By crafting a JWT with a malicious issuer or audience value, an unauthenticated attacker can cause Centrifugo to issue outbound HTTP requests to attacker-controlled or internal network destinations before the token is verified.

Affected context

This vulnerability manifests when Centrifugo is deployed with:

  • Dynamic JWKS endpoint URLs that interpolate template variables (e.g. {{tenant}}) into the URL
  • Template variables sourced from untrusted JWT claims such as iss (issuer) or aud (audience)
  • JWKS retrieval occurring before the JWT's authenticity and claims are fully validated

In such configurations, the server's HTTP client becomes an unwitting proxy, issuing requests based on attacker-controlled claim values to arbitrary URLs reachable from the Centrifugo host.

Exploit preconditions

  • Attack surface: Centrifugo's JWT-based authentication or authorization endpoints, including any path where a JWT is provided for verification.
  • Required access: No prior authentication is required if JWTs can be submitted anonymously (e.g. as part of a connection or API request).
  • Trigger point: The moment Centrifugo attempts to fetch the JWKS document from a dynamically constructed URL that interpolates untrusted claims into the JWKS endpoint template.
  • Why exploitation is possible: The JWKS URL template is resolved using data from the unverified JWT itself, allowing an attacker to control part or all of the destination URL and induce outbound HTTP requests from the server.

Why this happens

The root cause is the combination of:

  • Treating JWT claims as trusted input before cryptographic verification, and
  • Directly embedding those untrusted values into a server-side URL template used for outbound HTTP requests.

This aligns with CWE-918: Server-Side Request Forgery (SSRF), where a server-side component constructs and sends HTTP requests to arbitrary locations based on attacker-controlled input. In this case, the URL used for JWKS retrieval is dynamically generated using template variables populated from JWT claims (iss, aud, or similar). Because the token is parsed and its claim values interpolated before signature verification, the server effectively exposes its HTTP client as a programmable network pivot controlled by the attacker.

Potential impact

  • Discovery and interaction with internal services that are not directly exposed to the internet
  • Access to cloud metadata endpoints, potentially leaking credentials or tokens
  • Bypassing network-layer ACLs by tunneling requests through the Centrifugo server
  • Exfiltration of sensitive data from internal HTTP services or APIs
  • Use of Centrifugo as a stepping stone for further internal network reconnaissance and pivoting

General mitigation guidance

Effective mitigation focuses on decoupling untrusted claim data from network destinations and constraining all outbound calls:

  • Avoid unverified claims in URLs: Design JWKS endpoint configuration so that URLs are not derived directly from JWT claims or other untrusted input. Prefer static or controlled mappings over free-form templates.
  • Introduce strict URL allowlisting: Restrict JWKS fetches to a known, curated set of hosts or base URLs, rejecting or ignoring any value that does not match the allowlist.
  • Normalize trust boundaries: Treat all JWT content as untrusted until after signature verification and validation, and avoid using it to drive security-sensitive operations such as network requests, file paths, or configuration lookups.
  • Apply network-level egress controls: Use firewall rules, service meshes, or cloud security groups to limit where the Centrifugo process can initiate outbound HTTP connections, especially blocking access to metadata services and internal admin networks.
  • Adopt secure configuration defaults: Favor configuration patterns that are static, predictable, and easy to reason about, reducing reliance on dynamic URL templating for security-critical infrastructure like key discovery.

How teams detect issues like this

Detection can combine application-level review with infrastructure monitoring:

  • Static analysis and config review:
  • Flag use of dynamic JWKS URL templates that interpolate data from JWT claims or other user-controlled sources.
  • Review configuration and code paths where external URLs are constructed, especially those relating to authentication or key discovery.
  • Code review signals:
  • Any logic that parses tokens and immediately uses claim values to build URLs, hostnames, or paths prior to verification.
  • Patterns where template variables (e.g. {{tenant}}, {{iss}}, {{aud}}) are used in security-sensitive endpoints.
  • Runtime and network monitoring:
  • Monitor outbound HTTP traffic for unusual destinations originating from Centrifugo instances, including access to internal-only services.
  • Introduce alerting for attempts to contact known sensitive endpoints like cloud metadata services.
  • Automated tooling:
  • Incorporate SAST/IAST rules that detect SSRF-style URL construction in authentication components.
  • Use configuration linting or policy-as-code tools to enforce that JWKS URLs conform to approved patterns or domains.

Sources

SourceLink
github.comgithub.com/centrifugal/centrifugo/security/advisories/GHSA-j77h-rr39-c552

Frequently asked

questions

Yes. If Centrifugo accepts JWTs from unauthenticated or semi-trusted clients, an attacker on the internet can submit a crafted token that triggers an SSRF request to a destination of their choosing, subject to network reachability.

No. Exploitation relies on claim interpolation prior to signature verification. The attacker only needs to supply a syntactically valid JWT whose iss or aud claim controls the relevant template variable; the cryptographic validity of the token is not required to trigger the outbound request.

The robust fix is to eliminate the use of unverified token claims in constructing URLs or other security-sensitive resources. Configure JWKS endpoints as static or strictly mapped per-tenant using trusted configuration data, and enforce strong allowlists for any dynamic components.

Establish a design rule that no user-supplied or unverified data may be used directly as part of outbound network destinations. Combine this with secure defaults (static URLs, allowlists), centralized egress controls, security-focused code review around HTTP client usage, and automated checks that flag dynamic URL construction driven by untrusted inputs.

Find out what's already
exploitable in your codebase.