{"vuln_id":"CVE-2026-128073","aliases":["GHSA-5hj8-q7fv-qrj6","GHSA-hwqm-qvj9-4jr2"],"description":"gosaml2: Unauthenticated panic decrypting an EncryptedAssertion with a short or empty CipherValue","published_at":"2026-11-17T20:17:42.827000Z","modified_at":"2026-11-19T21:00:03.957442Z","first_seen_at":"2026-11-21T19:15:19.467732Z","severity":"high","severity_source":"nvd","cvss_score":7.5,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","cwe":["CWE-20","CWE-248"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00357,"epss_percentile":0.30016,"nvd_status":"Received","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-128073"},"matched_alias":null,"items":[{"id":10975,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-5hj8-q7fv-qrj6: gosaml2: Unauthenticated panic decrypting an EncryptedAssertion with a short or empty CipherValue","summary":"gosaml2: Unauthenticated panic decrypting an EncryptedAssertion with a short or empty CipherValue\n\n### Summary\n\nAn attacker who can supply a crafted SAML Response for parsing can crash a `gosaml2` service provider by sending an `EncryptedAssertion` with AES-GCM encryption metadata and a `CipherValue` shorter than the GCM nonce size (12 bytes). The library panics with `slice bounds out of range` before any validation completes.\n\nThis is a **distinct issue from [GHSA-hwqm-qvj9-4jr2](https://github.com/russellhaering/gosaml2/security/advisories/GHSA-hwqm-qvj9-4jr2)**, which addressed panics in the AES-CBC decryption path (commit [`3418f9ae09063ff8df0ce1bd93f24e538e614def`](https://github.com/russellhaering/gosaml2/commit/3418f9ae09063ff8df0ce1bd93f24e538e614def), included in `v0.10.0`). That fix added a block-size check for CBC but left the AES-GCM path completely unprotected.\n\n### Details\n\n`ValidateEncodedResponse()` decrypts `EncryptedAssertion` nodes before signature or content validation completes. There are two call sites:\n\n1. **Signed Response branch** -- [`decode_response.go#L341`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/decode_response.go#L341)\n2. **Unsigned Response branch** -- [`decode_response.go#L388`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/decode_response.go#L388)\n\nBoth call `decryptAssertions()` ([`decode_response.go#L150-L200`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/decode_response.go#L150-L200)), which calls `EncryptedAssertion.DecryptBytes()` at [`decode_response.go#L176`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/decode_response.go#L176).\n\nInside `DecryptBytes()` ([`types/encrypted_assertion.go#L34-L92`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/types/encrypted_assertion.go#L34-L92)), the AES-GCM branch ([line 53, `case MethodAES128GCM, MethodAES192GCM, MethodAES256GCM:`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/types/encrypted_assertion.go#L53)) slices the decoded ciphertext without checking its length at [line 59](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/types/encrypted_assertion.go#L59):\n\n```go\nnonce, data := data[:c.NonceSize()], data[c.NonceSize():]\n```\n\nIf `CipherValue` decodes to fewer than 12 bytes (GCM nonce size), Go panics with `slice bounds out of range`. All three GCM key sizes (AES-128-GCM, AES-192-GCM, AES-256-GCM) share the same vulnerable branch.\n\n**Comparison with the patched CBC path:** The CBC branch (lines 65-88 of the same file) correctly checks `len(data) % k.BlockSize() != 0` before slicing -- this was the fix for GHSA-hwqm-qvj9-4jr2. The GCM branch has no equivalent guard.\n\nThe attacker only needs the SP's public certificate (typically available in SAML metadata) to wrap a symmetric key via RSA-OAEP. The `CipherValue` for the assertion body can be left empty. No valid signature \n\nAffected: Go:github.com/russellhaering/gosaml2\n\nFixed in: 0.12.0\n\nReferences:\nhttps://github.com/russellhaering/gosaml2/security/advisories/GHSA-5hj8-q7fv-qrj6\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-128073\nhttps://github.com/russellhaering/gosaml2/pull/281\nhttps://github.com/russellhaering/gosaml2/commit/b2bd784b196b21f606faaa6a4eeae929bd75aa20\nhttps://github.com/russellhaering/gosaml2\nhttps://github.com/russellhaering/gosaml2/releases/tag/v0.12.0","url":"https://osv.dev/vulnerability/GHSA-5hj8-q7fv-qrj6","published_at":"2026-11-19T20:49:36Z","updated_at":"2026-11-19T21:00:03.957442Z","fetched_at":"2026-11-21T19:15:55.946342Z","severity":"high","cvss_score":7.5,"epss":0.00357,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/russellhaering/gosaml2","vuln_id":"CVE-2026-128073","vuln_ids":["CVE-2026-128073","GHSA-5HJ8-Q7FV-QRJ6","GHSA-HWQM-QVJ9-4JR2"],"tags":["osv","go","fix-available"],"cluster_id":2210,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10975","html":"https://vulnwatch.ve1ve2.com/item/10975"}},{"id":2391,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-5hj8-q7fv-qrj6 / CVE-2026-128073: gosaml2: Unauthenticated panic decrypting an EncryptedAssertion with a short or empty CipherValue","summary":"gosaml2: Unauthenticated panic decrypting an EncryptedAssertion with a short or empty CipherValue\n\n### Summary\n\nAn attacker who can supply a crafted SAML Response for parsing can crash a `gosaml2` service provider by sending an `EncryptedAssertion` with AES-GCM encryption metadata and a `CipherValue` shorter than the GCM nonce size (12 bytes). The library panics with `slice bounds out of range` before any validation completes.\n\nThis is a **distinct issue from [GHSA-hwqm-qvj9-4jr2](https://github.com/russellhaering/gosaml2/security/advisories/GHSA-hwqm-qvj9-4jr2)**, which addressed panics in the AES-CBC decryption path (commit [`3418f9ae09063ff8df0ce1bd93f24e538e614def`](https://github.com/russellhaering/gosaml2/commit/3418f9ae09063ff8df0ce1bd93f24e538e614def), included in `v0.10.0`). That fix added a block-size check for CBC but left the AES-GCM path completely unprotected.\n\n### Details\n\n`ValidateEncodedResponse()` decrypts `EncryptedAssertion` nodes before signature or content validation completes. There are two call sites:\n\n1. **Signed Response branch** -- [`decode_response.go#L341`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/decode_response.go#L341)\n2. **Unsigned Response branch** -- [`decode_response.go#L388`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/decode_response.go#L388)\n\nBoth call `decryptAssertions()` ([`decode_response.go#L150-L200`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/decode_response.go#L150-L200)), which calls `EncryptedAssertion.DecryptBytes()` at [`decode_response.go#L176`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/decode_response.go#L176).\n\nInside `DecryptBytes()` ([`types/encrypted_assertion.go#L34-L92`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/types/encrypted_assertion.go#L34-L92)), the AES-GCM branch ([line 53, `case MethodAES128GCM, MethodAES192GCM, MethodAES256GCM:`](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/types/encrypted_assertion.go#L53)) slices the decoded ciphertext without checking its length at [line 59](https://github.com/russellhaering/gosaml2/blob/636e7dda202a4d669644e72404a82616ffcbe004/types/encrypted_assertion.go#L59):\n\n```go\nnonce, data := data[:c.NonceSize()], data[c.NonceSize():]\n```\n\nIf `CipherValue` decodes to fewer than 12 bytes (GCM nonce size), Go panics with `slice bounds out of range`. All three GCM key sizes (AES-128-GCM, AES-192-GCM, AES-256-GCM) share the same vulnerable branch.\n\n**Comparison with the patched CBC path:** The CBC branch (lines 65-88 of the same file) correctly checks `len(data) % k.BlockSize() != 0` before slicing -- this was the fix for GHSA-hwqm-qvj9-4jr2. The GCM branch has no equivalent guard.\n\nThe attacker only needs the SP's public certificate (typically available in SAML metadata) to wrap a symmetric key via RSA-OAEP. The `CipherValue` for the assertion body can be left empty. No valid signature \n\nAffected packages: go:github.com/russellhaering/gosaml2\nPatched: github.com/russellhaering/gosaml2 0.12.0","url":"https://github.com/advisories/GHSA-5hj8-q7fv-qrj6","published_at":"2026-11-19T20:49:36Z","updated_at":"2026-11-19T20:49:37Z","fetched_at":"2026-11-21T19:15:18.416801Z","severity":"high","cvss_score":7.5,"epss":0.00357,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/russellhaering/gosaml2","vuln_id":"CVE-2026-128073","vuln_ids":["CVE-2026-128073","GHSA-5HJ8-Q7FV-QRJ6","GHSA-HWQM-QVJ9-4JR2"],"tags":["ghsa","go","CWE-20","CWE-248"],"cluster_id":2210,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2391","html":"https://vulnwatch.ve1ve2.com/item/2391"}},{"id":6629,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-128073: gosaml2 is a Pure Go implementation of SAML 2.0. Prior to 0.12.0, ValidateEncodedResponse() calls decryptAssertions() on an EncryptedAssertion before signature…","summary":"gosaml2 is a Pure Go implementation of SAML 2.0. Prior to 0.12.0, ValidateEncodedResponse() calls decryptAssertions() on an EncryptedAssertion before signature or content validation completes, and EncryptedAssertion.DecryptBytes() in types/encrypted_assertion.go slices decoded ciphertext without first validating the required nonce or initialization-vector length. A CipherValue shorter than the 12-byte AES-GCM nonce causes a slice-bounds panic, and an empty AES-CBC CipherValue passes the modulo block-size check before causing a slice-bounds panic at the 16-byte initialization-vector split. An attacker needs only the service provider's public certificate to wrap a symmetric key, and no valid identity-provider signature or relationship is required. The unrecovered panic can terminate the request goroutine or the service process. This issue is fixed in version 0.12.0.\n\nReferences:\nhttps://github.com/russellhaering/gosaml2/commit/b2bd784b196b21f606faaa6a4eeae929bd75aa20\nhttps://github.com/russellhaering/gosaml2/pull/281\nhttps://github.com/russellhaering/gosaml2/releases/tag/v0.12.0\nhttps://github.com/russellhaering/gosaml2/security/advisories/GHSA-5hj8-q7fv-qrj6\nhttps://github.com/russellhaering/gosaml2/security/advisories/GHSA-5hj8-q7fv-qrj6","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-128073","published_at":"2026-11-17T20:17:42.827000Z","updated_at":"2026-11-19T04:17:24.673000Z","fetched_at":"2026-11-21T19:15:31.482429Z","severity":"high","cvss_score":7.5,"epss":0.00357,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-128073","vuln_ids":["CVE-2026-128073","GHSA-5HJ8-Q7FV-QRJ6","GHSA-HWQM-QVJ9-4JR2"],"tags":["CWE-20","CWE-248"],"cluster_id":2211,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/6629","html":"https://vulnwatch.ve1ve2.com/item/6629"}}]}