Skip to content

Commit 20bea48

Browse files
1 parent f9bd25e commit 20bea48

2 files changed

Lines changed: 127 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-q926-c743-49qj",
4+
"modified": "2026-03-13T20:44:37Z",
5+
"published": "2026-03-13T20:44:37Z",
6+
"aliases": [],
7+
"summary": "Centrifugo's InsecureSkipTokenSignatureVerify flag silently disables JWT verification with no warning",
8+
"details": "### Summary\nCentrifugo 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.\n\nNote: 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.\n\n### Details\nThe flag is defined in `internal/configtypes/types.go`:\n```\nInsecureSkipTokenSignatureVerify bool `mapstructure:\"insecure_skip_token_signature_verify\"`\n```\n\nIt is passed directly to token verification in `internal/client/handler.go`:\n```\ntoken, err := h.tokenVerifier.VerifyConnectToken(e.Token, \n cfg.Client.InsecureSkipTokenSignatureVerify)\n```\n\nIn `token_verifier_jwt.go`, when `skipVerify=true` the entire signature block is bypassed:\n```go\nif !skipVerify {\n // This block never executes\n err = verifier.verifySignature(token)\n}\n```\nThe flag is configurable via multiple vectors making accidental exposure likely:\n- Config file: `insecure_skip_token_signature_verify: true`\n- Environment variable: `CENTRIFUGO_INSECURE_SKIP_TOKEN_SIGNATURE_VERIFY=true`\n- YAML, TOML config formats\n\nDespite `hmac_secret_key` being configured, startup logs show `\"enabled JWT verifiers\"` — falsely implying verification is active.\n\n### PoC\nConfig with legitimate HMAC key but skip flag enabled:\n```json\n{\n \"client\": {\n \"insecure_skip_token_signature_verify\": true,\n \"token\": { \"hmac_secret_key\": \"legitimate-production-secret-key\" }\n }\n}\n```\n\nToken signed with completely wrong key is fully accepted:\n```\nVULNERABILITY CONFIRMED!\nConnected as user: {'client': '899dec73...', 'version': '0.0.0 OSS'}\n```\n\nNo security warning emitted when insecure_skip_token_signature_verify=true:\n![1](https://github.com/user-attachments/assets/606acae0-e6f7-467f-b512-b5350ec6cf38)\n\nToken signed with wrong key accepted, authentication bypass confirmed:\n![2](https://github.com/user-attachments/assets/a400c0bf-b78c-40cf-8c73-07fdabb0c672)\n\nskipVerify flag propagated from config to all token verification calls:\n![3](https://github.com/user-attachments/assets/4141eb05-0371-46e1-acb7-8a9091c45693)\n\n### Impact\n- Any unauthenticated user can connect as any arbitrary user ID\n- Complete authentication bypass — attacker sets any `sub` claim value\n- No indicators in logs that the server is operating insecurely\n- Easily triggered accidentally via environment variable injection\n in containerized deployments (e.g. misconfigured Kubernetes secrets)\n- Affects all connection types: WebSocket, HTTP-streaming, SSE, GRPC\n \n### Suggested Fix\n1. Emit a loud startup warning when flag is enabled:\n```go\nif cfg.Client.InsecureSkipTokenSignatureVerify {\n log.Warn().Msg(\"SECURITY WARNING: JWT signature verification is \" +\n \"DISABLED via insecure_skip_token_signature_verify - \" + \n \"DO NOT use in production!\")\n}\n```\n2. Consider requiring an additional explicit `insecure_mode: true` flag to prevent accidental single-flag misconfiguration\n3. Log a warning on every accepted token when skip is active",
9+
"severity": [
10+
{
11+
"type": "CVSS_V3",
12+
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Go",
19+
"name": "github.com/centrifugal/centrifugo/v6"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "6.7.0"
30+
}
31+
]
32+
}
33+
],
34+
"database_specific": {
35+
"last_known_affected_version_range": "<= 6.6.2"
36+
}
37+
}
38+
],
39+
"references": [
40+
{
41+
"type": "WEB",
42+
"url": "https://github.com/centrifugal/centrifugo/security/advisories/GHSA-q926-c743-49qj"
43+
},
44+
{
45+
"type": "WEB",
46+
"url": "https://github.com/centrifugal/centrifugo/commit/dab80fe3adfe0bbeca3bb3ea45e6d95df9f601a8"
47+
},
48+
{
49+
"type": "PACKAGE",
50+
"url": "https://github.com/centrifugal/centrifugo"
51+
},
52+
{
53+
"type": "WEB",
54+
"url": "https://github.com/centrifugal/centrifugo/releases/tag/v6.7.0"
55+
}
56+
],
57+
"database_specific": {
58+
"cwe_ids": [
59+
"CWE-285"
60+
],
61+
"severity": "LOW",
62+
"github_reviewed": true,
63+
"github_reviewed_at": "2026-03-13T20:44:37Z",
64+
"nvd_published_at": null
65+
}
66+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-r353-4845-pr5p",
4+
"modified": "2026-03-13T20:44:21Z",
5+
"published": "2026-03-13T20:44:21Z",
6+
"aliases": [
7+
"CVE-2026-32600"
8+
],
9+
"summary": "simplesamlphp/xml-security: Missing AES-GCM Authentication Tag Validation on Encrypted Nodes Allows for Unauthorized Decryption",
10+
"details": "### Summary\n\nXML nodes encrypted with either aes-128-gcm, aes-192-gcm, or aes-256-gcm lack validation of the authentication tag length.\nAn attacker can use this to brute-force an authentication tag, recover the [GHASH key](https://en.wikipedia.org/wiki/Galois/Counter_Mode#:~:text=%29%20is%20the-,hash%20key,-%2C%20a%20string%20of), and decrypt the encrypted nodes.\nIt also allows to forge arbitrary ciphertexts without knowing the encryption key.\n\n### Details\n\nWhen decrypting with either aes-128-gcm, aes-192-gcm, or aes-256-gcm [here](https://github.com/robrichards/xmlseclibs/blob/2bdfd742624d739dfadbd415f00181b4a77aaf07/src/XMLSecurityKey.php#L467-L479), the $authTag is set from a substr(), but never has its length validated (it should be validated with something like strlen($authTag) == self::AUTHTAG_LENGTH).\nFor that reason, a shorter than expected data blob will allow for the $authTag to have as short a tag as only one byte (see [PHP's documentation](https://www.php.net/manual/en/function.openssl-decrypt.php#:~:text=The%20length%20of%20the%20tag%20is%20not%20checked%20by%20the%20function.%20It%20is%20the%20caller%27s%20responsibility%20to%20ensure%20that%20the%20length%20of%20the%20tag%20matches%20the%20length%20of%20the%20tag%20retrieved%20when%20openssl_encrypt()%20has%20been%20called.%20Otherwise%20the%20decryption%20may%20succeed%20if%20the%20given%20tag%20only%20matches%20the%20start%20of%20the%20proper%20tag.)).\n\nSee this example:\n\n```php\nfunction test($data) {\n $ivSize = 12;\n $tagSize = 16;\n\n $iv = substr($data, 0, $ivSize);\n $data = substr($data, $ivSize);\n $offset = 0 - $tagSize;\n $tag = substr($data, $offset);\n $ct = substr($data, 0, $offset);\n\n echo 'IV: \"' . $iv . '\"' . PHP_EOL;\n echo 'Tag: \"' . $tag . '\"' . PHP_EOL;\n echo 'CT: \"' . $ct . '\"' . PHP_EOL;\n}\n\n/* Outputs:\nphp > test('myNonceNoncet');\nIV: \"myNonceNonce\"\nTag: \"t\"\nCT: \"\"\nphp > test('myNonceNonceta');\nIV: \"myNonceNonce\"\nTag: \"ta\"\nCT: \"\"\nphp > test('myNonceNoncetag');\nIV: \"myNonceNonce\"\nTag: \"tag\"\nCT: \"\"\n*/\n```\n\nWith a legit ciphertext in hand, this is enough to recover the [GHASH key](https://en.wikipedia.org/wiki/Galois/Counter_Mode#:~:text=%29%20is%20the-,hash%20key,-%2C%20a%20string%20of).\nWith that key, any authenticated tags can be computed offline which allows for decryption of the ciphertext and forgery of arbitrary ciphertexts.\nPoC\n\n1. Setup a server expecting XML with an encrypted assertion\n - Run this php script [poc.php](https://github.com/user-attachments/files/24426600/poc.php.txt) with php -S 127.0.0.1:8888 (taken from [this saml test case](https://github.com/robrichards/xmlseclibs/blob/69fd63080bc47a8d51bc101c30b7cb756862d1d6/tests/saml/saml-decrypt.phpt#L62))\n\n - The script expects this private key: [sp-private-key.pem.](https://github.com/user-attachments/files/24426620/sp-private-key.pem.txt)\n\n2. Create an XML document with an encrypted assertion (encrypted with aes-256-gcm)\n\nHere is the SAMLResponse used in the video below: [saml_response.txt](https://github.com/user-attachments/files/24426638/saml_response.txt)\n\nNote: The steps from 3 to 6 are implemented in this exploit script: [nonce_reuse_with_fmt_val_oracle.py](https://github.com/user-attachments/files/24426645/nonce_reuse_with_fmt_val_oracle.py).\nYou can run the script with sage -python nonce_reuse_with_fmt_val_oracle.py -s 'url-encoded_and_base64-encoded_samlresponse'\n\n3. Take the content of the <xenc:CipherValue> node and apply the following modifications\n\n- Base64-decode the content\n\n- Take the first 12 bytes and save them as the nonce\n\n- Take the last 16 bytes and save them as the tag\n\n- Now brute-force the tag of an empty ciphertext\n\n - Loop through all 256 possible byte values (let's call that byte_tag_attempt)\n\n - Concatenate together the nonce and the byte_tag_attempt\n\n - Base64-encode the result\n\n - Replace the content of the <xenc:CipherValue> node with this result\n\n - On http errors 500, we learn that the tag is valid\n\n - Do the same for the next byte of the tag until all 16 bytes have been brute-forced\n\n4. With this new tag and the empty ciphertext, compute the [GHASH key](https://en.wikipedia.org/wiki/Galois/Counter_Mode#:~:text=%29%20is%20the-,hash%20key,-%2C%20a%20string%20of) (the way to do this has been described in this [blog post](https://frereit.de/aes_gcm/))\n\n5. Use this [GHASH key](https://en.wikipedia.org/wiki/Galois/Counter_Mode#:~:text=%29%20is%20the-,hash%20key,-%2C%20a%20string%20of) to compute authentication tags offline for arbitrary ciphertexts\n\n6. Decryption is done by observing XML parsing errors that occur after modifying the ciphertext, those can be seen as http errors 500\n\nhttps://private-user-images.githubusercontent.com/20672053/531768743-2f6e4a7e-4384-4350-b423-7ddd77aa9152.webm?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzMzMTQ3MjEsIm5iZiI6MTc3MzMxNDQyMSwicGF0aCI6Ii8yMDY3MjA1My81MzE3Njg3NDMtMmY2ZTRhN2UtNDM4NC00MzUwLWI0MjMtN2RkZDc3YWE5MTUyLndlYm0_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxMlQxMTIwMjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zNDRhZThlYTY5OWNmNGZmMmNmOGJhYTNkNzAwMjNiMTVhMDMxOTIzMGRkN2Y3OGU3NTI3NmFkMWE2OTgwMDFhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.X9UVe9qpwX1YQYo34WmUI84KA0a28FKd4SGy15GEVMU\n\n### Impact\n\nThe general impact is:\n\nXML nodes encrypted with AES-GCM can be decrypted by observing parsing differences\nXML nodes encrypted with AES-GCM can be modified to decrypt to an arbitrary value\nThe GCM internal [GHASH key](https://en.wikipedia.org/wiki/Galois/Counter_Mode#:~:text=%29%20is%20the-,hash%20key,-%2C%20a%20string%20of) can be recovered\n\nIn cases where the encryption key is embedded in the XML and is encrypted with the Service Provider's public key (like often done with SAML), the last two items don't have a big impact.\nThis is because:\n\nWith the Service Provider's public key, an arbitrary ciphertext can be created with a known symmetric key\nThe symmetric keys are generated on the fly every time the IdP creates a new SAMLResponse\n\nIn any case, secrets that are embedded in the XML, whether coming from an IdP, or from another scheme, can be decrypted.\n\nImportant: If static symmetric keys are used, as the [GHASH key](https://en.wikipedia.org/wiki/Galois/Counter_Mode#:~:text=%29%20is%20the-,hash%20key,-%2C%20a%20string%20of) could have leaked, you must rotate those keys.\n\n### References\nFor additional information on the issue, you can refer to this [blog post](https://sideni.xyz/posts/exploiting_openssl_api/) about the OpenSSL issue and how it can be exploited.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Packagist",
21+
"name": "simplesamlphp/xml-security"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "2.3.1"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/simplesamlphp/xml-security/security/advisories/GHSA-r353-4845-pr5p"
42+
},
43+
{
44+
"type": "WEB",
45+
"url": "https://github.com/simplesamlphp/xml-security/commit/fdc12449e959c610943f9fd428e95e3832d74c25"
46+
},
47+
{
48+
"type": "PACKAGE",
49+
"url": "https://github.com/simplesamlphp/xml-security"
50+
}
51+
],
52+
"database_specific": {
53+
"cwe_ids": [
54+
"CWE-354"
55+
],
56+
"severity": "HIGH",
57+
"github_reviewed": true,
58+
"github_reviewed_at": "2026-03-13T20:44:21Z",
59+
"nvd_published_at": null
60+
}
61+
}

0 commit comments

Comments
 (0)