Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/russellhaering/gosaml2
  4. ›
  5. GHSA-hwqm-qvj9-4jr2

GHSA-hwqm-qvj9-4jr2: gosaml2 CBC Padding Panic — Unauthenticated Process Crash

March 18, 2026

The AES-CBC decryption path in DecryptBytes() panics on crafted ciphertext whose plaintext is all zero bytes. After decryption, bytes.TrimRight(data, "\x00") empties the slice, then data[len(data)-1] panics with index out of range [-1]. There is no recover() in the library. The panic propagates through ValidateEncodedResponse and kills the goroutine (or the entire process in non-net/http servers). An attacker needs only the SP’s public RSA key (published in SAML metadata) to construct the payload — no valid signature is required.

References

  • github.com/advisories/GHSA-hwqm-qvj9-4jr2
  • github.com/russellhaering/gosaml2
  • github.com/russellhaering/gosaml2/security/advisories/GHSA-hwqm-qvj9-4jr2

Code Behaviors & Features

Detect and mitigate GHSA-hwqm-qvj9-4jr2 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.11.0

Fixed versions

  • 0.11.0

Solution

Upgrade to version 0.11.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-129: Improper Validation of Array Index

Source file

go/github.com/russellhaering/gosaml2/GHSA-hwqm-qvj9-4jr2.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:28 +0000.