Skip to content

← Public intelligence

Go package

github.com/russellhaering/gosaml2

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

7 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. High, CVSS 7.5GoPublished

    Unsigned SAML LogoutRequest Acceptance in gosaml2

    GHSA-pcgw-qcv5-h8ch

    Affected
    • Go github.com/russellhaering/gosaml2 <= 0.10.0
    Fixed in
    0.11.0· Vendor fix available
    Issue
    The ValidateEncodedLogoutRequestPOST function in gosaml2 accepts completely unsigned SAML LogoutRequest messages even when SkipSignatureValidation is set to false. When validateElementSignature returns dsig.ErrMissingSignature, the code in decodelogoutrequest.go:60-62 silently falls through to process the unverified XML element instead of rejecting it. An attacker who can reach the SP's Single Logout endpoint can forge a LogoutRequest for any user, terminating their session without possessing the IdP's signing key. Affected Version - Library: github.com/russellhaering/gosaml2 - Version: All versions up to and including the latest commit on main (as of 2026-03-16) - File: decodelogoutrequest.go, lines 58-69 Vulnerable Code When ErrMissingSignature is returned, the code resets el to the raw document root and continues. The requestSignatureValidated variable remains false, but no error is returned. The unsigned LogoutRequest is unmarshalled and passed to…

    Recommended action: Upgrade to 0.11.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  2. High, CVSS 8.7GoPublished

    gosaml2 CBC Padding Panic — Unauthenticated Process Crash

    GHSA-hwqm-qvj9-4jr2

    Affected
    • Go github.com/russellhaering/gosaml2 <= 0.10.0
    Fixed in
    0.11.0· Vendor fix available
    Issue
    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. Affected Version All versions of github.com/russellhaering/gosaml2 through latest (v0.9.0 and HEAD) that support AES-CBC encrypted assertions. Vulnerable Code types/encryptedassertion.go:65-79 — DecryptBytes, AES-CBC branch: Attack Details | Property | Value | |---|---| | Attack Vector | Network (unauthenticated HTTP POST to ACS endpoint) | | Authentication Required | None | | Attacker Knowledge | SP's public RSA certificate (published in SAML…

    Recommended action: Upgrade to 0.11.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  3. Medium, CVSS 5.3GoPublished

    gosaml2 vulnerable to Denial Of Service Via Deflate Decompression Bomb

    CVE-2023-26483 · GHSA-6gc3-crp7-25w5

    Affected
    • Go github.com/russellhaering/gosaml2 < 0.9.0
    Fixed in
    0.9.0· Vendor fix available
    Issue
    Impact SAML Service Providers using this library for SAML authentication support are likely susceptible to Denial of Service attacks. A bug in this library enables attackers to craft a deflate-compressed request which will consume significantly more memory during processing than the size of the original request. This may eventually lead to memory exhaustion and the process being killed. Mitigation The maximum compression ratio achievable with deflate is 1032:1, so by limiting the size of bodies passed to gosaml2, limiting the rate and concurrency of calls, and ensuring that lots of memory is available to the process it may be possible to help Go's garbage collector "keep up". Implementors are encouraged not to rely on this. Patches This issue is addressed in v0.9.0

    Recommended action: Upgrade to 0.9.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  4. High, CVSS 7.5GoPublished

    github.com/russellhaering/gosaml2 is vulnerable to NULL Pointer Dereference

    CVE-2020-7731 · GHSA-prjq-f4q3-fvfr

    Affected
    • Go github.com/russellhaering/gosaml2 < 0.7.0
    Fixed in
    0.7.0· Vendor fix available
    Issue
    Impact In versions prior to v0.7.0 it was possible for an attacker to supply an invalid assertion which would trigger a panic due to a nil-pointer dereference. Patches The issue was patched in v0.7.0, released on March 2, 2022. Workarounds Callers to gosaml2 can use recover() to handle panics to mitigate a potential DoS. References See issue #59 for details.

    Recommended action: Upgrade to 0.7.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  5. High, CVSS 7.5GoPublished

    goxmldsig vulnerable to crash on nil-pointer dereference caused by sending malformed XML signatures

    CVE-2020-7711 · GHSA-mqqv-chpx-vq25

    Affected
    • Go github.com/russellhaering/gosaml2 < 0.7.0
    Fixed in
    0.7.0· Vendor fix available
    Issue
    This affects all versions of package github.com/russellhaering/goxmldsig prior to 1.1.1. There is a crash on nil-pointer dereference caused by sending malformed XML signatures. This issue is patched in version 1.1.1.

    Recommended action: Upgrade to 0.7.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  6. Critical, CVSS 9.8GoPublished

    Authentication Bypass in github.com/russellhaering/gosaml2

    CVE-2020-29509 · GHSA-xhqq-x44f-9fgg

    Affected
    • Go github.com/russellhaering/gosaml2 < 0.6.0
    Fixed in
    0.6.0· Vendor fix available
    Issue
    Impact Given a valid SAML Response, it may be possible for an attacker to mutate the XML document in such a way that gosaml2 will trust a different portion of the document than was signed. Depending on the implementation of the Service Provider this enables a variety of attacks, including users accessing accounts other than the one to which they authenticated in the Identity Provider, or full authentication bypass. Patches Service Providers utilizing gosaml2 should upgrade to v0.6.0 or greater.

    Recommended action: Upgrade to 0.6.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  7. UnratedGoPublished

    Signature Validation Bypass

    GHSA-5684-g483-2249

    Affected
    • Go github.com/russellhaering/gosaml2 < 0.5.0
    Fixed in
    0.5.0· Vendor fix available
    Issue
    Impact Given a valid SAML Response, an attacker can potentially modify the document, bypassing signature validation in order to pass off the altered document as a signed one. This enables a variety of attacks, including users accessing accounts other than the one to which they authenticated in the identity provider, or full authentication bypass if an external attacker can obtain an expired, signed SAML Response. Patches A patch is available, users of gosaml2 should upgrade to v0.5.0 or higher. References See the underlying advisory on goxmldsig for more details.

    Recommended action: Upgrade to 0.5.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →