# GHSA-q926-c743-49qj: Centrifugo's InsecureSkipTokenSignatureVerify flag silently disables JWT verification with no warning

> Centrifugo allows JWT signature verification bypass if a specific insecure flag is enabled, leading to unauthorized access without operator warnings.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 13 Mar 2026
- **Also known as:** GO-2026-4703

## What is GHSA-q926-c743-49qj?

GHSA-q926-c743-49qj is an authentication bypass vulnerability in github.com/centrifugal/centrifugo, published on 13 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Summary
Centrifugo supports a configuration flag `insecure_skip_token_signature_verify` that completely disables JWT signature verification. When enabled, Centrifugo accepts any JWT token regardless of signature validity — including tokens signed with wrong keys, random signatures, or no signature at all. Critically, no warning is logged at startup or runtime when this flag is active, making it invisible to operators and security auditors.

Note: This vulnerability requires the operator to have explicitly set insecure_skip_token_signature_verify=true. The core issue is the absence of any warning when this flag is active, making accidental production exposure undetectable.

### Details
The flag is defined in `internal/configtypes/types.go`:
```
InsecureSkipTokenSignatureVerify bool `mapstructure:"insecure_skip_token_signature_verify"`
```

It is passed directly to token verification in `internal/client/handler.go`:
```
token, err := h.tokenVerifier.VerifyConnectToken(e.Token, 
    cfg.Client.InsecureSkipTokenSignatureVerify)
```

In `token_verifier_jwt.go`, when `skipVerify=true` the entire signature block is bypassed:
```go
if !skipVerify {
    // This block never executes
    err = verifier.verifySignature(token)
}
```
The flag is configurable via multiple vectors making accidental exposure likely:
- Config file: `insecure_skip_token_signature_verify: true`
- Environment variable: `CENTRIFUGO_INSECURE_SKIP_TOKEN_SIGNATURE_VERIFY=true`
- YAML, TOML config formats

Despite `hmac_secret_key` being configured, startup logs show `"enabled JWT verifiers"` — falsely implying verification is active.

### PoC
Config with legitimate HMAC key but skip flag enabled:
```json
{
  "client": {
    "insecure_skip_token_signature_verify": true,
    "token": { "hmac_secret_key": "legitimate-production-secret-key" }
  }
}
```

Token signed with completely wrong key is fully accepted:
```
VULNERABILITY CONFIRMED!
Connected as user: {'client': '899dec73...', 'version': '0.0.0 OSS'}
```

No security warning emitted when insecure_skip_token_signature_verify=true:
![1](https://github.com/user-attachments/assets/606acae0-e6f7-467f-b512-b5350ec6cf38)

Token signed with wrong key accepted, authentication bypass confirmed:
![2](https://github.com/user-attachments/assets/a400c0bf-b78c-40cf-8c73-07fdabb0c672)

skipVerify flag propagated from config to all token verification calls:
![3](https://github.com/user-attachments/assets/4141eb05-0371-46e1-acb7-8a9091c45693)

### Impact
- Any unauthenticated user can connect as any arbitrary user ID
- Complete authentication bypass — attacker sets any `sub` claim value
- No indicators in logs that the server is operating insecurely
- Easily triggered accidentally via environment variable injection
  in containerized deployments (e.g. misconfigured Kubernetes secrets)
- Affects all connection types: WebSocket, HTTP-streaming, SSE, GRPC
 
### Suggested Fix
1. Emit a loud startup warning when flag is enabled:
```go
if cfg.Client.InsecureSkipTokenSignatureVerify {
    log.Warn().Msg("SECURITY WARNING: JWT signature verification is " +
        "DISABLED via insecure_skip_token_signature_verify - " + 
        "DO NOT use in production!")
}
```
2. Consider requiring an additional explicit `insecure_mode: true` flag to prevent accidental single-flag misconfiguration
3. Log a warning on every accepted token when skip is active

## Which versions are affected by GHSA-q926-c743-49qj?

15 open source packages ship an affected version, including github.com/centrifugal/centrifugo, github.com/centrifugal/centrifugo/v3 and github.com/centrifugal/centrifugo/v4.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/centrifugal/centrifugo` | Go | All versions | None |
| `github.com/centrifugal/centrifugo` | Go | All versions to 2.4.0 | None |
| `github.com/centrifugal/centrifugo` | Go | All versions to 2.4.0 | None |
| `github.com/centrifugal/centrifugo/v3` | Go | All versions | None |
| `github.com/centrifugal/centrifugo/v3` | Go | All versions to 3.2.3 | None |
| `github.com/centrifugal/centrifugo/v3` | Go | All versions to 3.2.3 | None |
| `github.com/centrifugal/centrifugo/v4` | Go | All versions | None |
| `github.com/centrifugal/centrifugo/v4` | Go | All versions to 4.1.5 | None |
| `github.com/centrifugal/centrifugo/v4` | Go | All versions to 4.1.5 | None |
| `github.com/centrifugal/centrifugo/v5` | Go | All versions | None |
| `github.com/centrifugal/centrifugo/v5` | Go | All versions to 5.4.9 | None |
| `github.com/centrifugal/centrifugo/v5` | Go | All versions to 5.4.9 | None |
| `github.com/centrifugal/centrifugo/v6` | Go | All versions | 6.7.0 |
| `github.com/centrifugal/centrifugo/v6` | Go | All versions | 6.7.0 |
| `github.com/centrifugal/centrifugo/v6` | Go | All versions | 6.7.0 |

## How do I fix GHSA-q926-c743-49qj?

Change a configuration setting.

## Is GHSA-q926-c743-49qj being exploited?

There is no known exploitation of GHSA-q926-c743-49qj in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-q926-c743-49qj and fix it if it is affected.

What it is: GHSA-q926-c743-49qj is an authentication bypass vulnerability in github.com/centrifugal/centrifugo, published on 13 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-q926-c743-49qj in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/centrifugal/centrifugo (Go): affected all versions; no fix listed
- github.com/centrifugal/centrifugo (Go): affected all versions up to 2.4.0; no fix listed
- github.com/centrifugal/centrifugo (Go): affected all versions up to 2.4.0; no fix listed
- github.com/centrifugal/centrifugo/v3 (Go): affected all versions; no fix listed
- github.com/centrifugal/centrifugo/v3 (Go): affected all versions up to 3.2.3; no fix listed
- github.com/centrifugal/centrifugo/v3 (Go): affected all versions up to 3.2.3; no fix listed
- github.com/centrifugal/centrifugo/v4 (Go): affected all versions; no fix listed
- github.com/centrifugal/centrifugo/v4 (Go): affected all versions up to 4.1.5; no fix listed
- github.com/centrifugal/centrifugo/v4 (Go): affected all versions up to 4.1.5; no fix listed
- github.com/centrifugal/centrifugo/v5 (Go): affected all versions; no fix listed
- github.com/centrifugal/centrifugo/v5 (Go): affected all versions up to 5.4.9; no fix listed
- github.com/centrifugal/centrifugo/v5 (Go): affected all versions up to 5.4.9; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-q926-c743-49qj/ (Markdown: https://insights.sbomify.com/GHSA-q926-c743-49qj/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-q926-c743-49qj

---
From sbomify Insights: https://insights.sbomify.com/GHSA-q926-c743-49qj/
Summaries are generated and may contain mistakes; the official description above is the record.
