CVE-2020-29509: Github.com/russellhaering/gosaml2 Authentication Bypass Vulnerability

CRITICAL
Advisory Identifier: GHSA-xhqq-x44f-9fgg
CVSS 9.8
CWE-115
Published
Advisory Summary

CVE-2020-29509 is a CRITICAL (CVSS 9.8) authentication bypass vulnerability (CWE-115: Misinterpretation of Input) affecting Github.com/russellhaering/gosaml2 libraries in the Go ecosystem. The issue involves authentication bypass in github.com/russellhaering/gosaml2. Remediation is available by upgrading affected packages to version 0.6.0.

CVE-2020-29509 at a Glance

CVE Identifier CVE-2020-29509
GHSA Identifier GHSA-xhqq-x44f-9fgg
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-115: Misinterpretation of Input
Affected Product Github.com/russellhaering/gosaml2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2020-29509

To remediate this vulnerability, upgrade all affected Github.com/russellhaering/gosaml2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/russellhaering/gosaml2 fixed: 0.6.0
Upgrade github.com/russellhaering/gosaml2 to 0.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/russellhaering/gosaml2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-29509, inspect your project dependencies for Github.com/russellhaering/gosaml2:

inspect dependencies for github.com/russellhaering/gosaml2

Analyze the terminal output to locate any version of Github.com/russellhaering/gosaml2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-115: Misinterpretation of Input, where the product misinterprets an input, whether from an attacker or another product, in a security-relevant fashion. In Github.com/russellhaering/gosaml2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2020-29509 Affected Github.com/russellhaering/gosaml2 Versions

1 component(s)
Fixed Versions:
0.6.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/russellhaering/gosaml2
Go
< 0.6.0
0.6.0

References

Frequently Asked Questions

What is CVE-2020-29509?
CVE-2020-29509 is a security vulnerability in Github.com/russellhaering/gosaml2 involving Authentication Bypass in github.com/russellhaering/gosaml2 under CWE-115: Misinterpretation of Input.
Which Github.com/russellhaering/gosaml2 versions are affected?
Affected versions include releases prior to 0.6.0 across affected packages: github.com/russellhaering/gosaml2.
What version fixes CVE-2020-29509?
Upgrading to 0.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/russellhaering/gosaml2 affected?
Yes, github.com/russellhaering/gosaml2 is affected in releases prior to 0.6.0. Upgrade your dependency to 0.6.0 or later.
What is the CVSS score of CVE-2020-29509?
CVE-2020-29509 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-29509?
CVE-2020-29509 is classified under CWE-115: Misinterpretation of Input (The product misinterprets an input, whether from an attacker or another product, in a security-relevant fashion.).
How can I check Go dependencies for CVE-2020-29509?
Run the dependency tree command: 'inspect dependencies for github.com/russellhaering/gosaml2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xhqq-x44f-9fgg",
  "modified" : "2021-05-21T21:11:37Z",
  "published" : "2022-02-11T23:58:09Z",
  "aliases" : [ "CVE-2020-29509" ],
  "summary" : "Authentication Bypass in github.com/russellhaering/gosaml2",
  "details" : "### Impact\nGiven 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.\n\nDepending 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.\n\n### Patches\nService Providers utilizing gosaml2 should upgrade to v0.6.0 or greater.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/russellhaering/gosaml2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/russellhaering/gosaml2/security/advisories/GHSA-xhqq-x44f-9fgg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-29509"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/russellhaering/gosaml2/commit/42606dafba60c58c458f14f75c4c230459672ab9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mattermost/xml-roundtrip-validator/blob/master/advisories/unstable-attributes.md"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2021-0060"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20210129-0006"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-115" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-21T21:11:37Z",
    "nvd_published_at" : "2020-12-14T20:15:00Z"
  }
}