CVE-2023-26483: Github.com/russellhaering/gosaml2 Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-6gc3-crp7-25w5
CVSS 5.3
CWE-409
Published
Advisory Summary

CVE-2023-26483 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)) affecting Github.com/russellhaering/gosaml2 libraries in the Go ecosystem. The issue involves gosaml2 vulnerable to denial of service via deflate decompression bomb. Remediation is available by upgrading affected packages to version 0.9.0.

CVE-2023-26483 at a Glance

CVE Identifier CVE-2023-26483
GHSA Identifier GHSA-6gc3-crp7-25w5
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected Product Github.com/russellhaering/gosaml2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:N/I:N/A:L).

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 None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2023-26483

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.9.0
Upgrade github.com/russellhaering/gosaml2 to 0.9.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-2023-26483, 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.9.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-409: Improper Handling of Highly Compressed Data (Data Amplification), where the product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output. 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 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

CVE-2023-26483 Affected Github.com/russellhaering/gosaml2 Versions

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

References

Frequently Asked Questions

What is CVE-2023-26483?
CVE-2023-26483 is a security vulnerability in Github.com/russellhaering/gosaml2 involving gosaml2 vulnerable to Denial Of Service Via Deflate Decompression Bomb under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification).
Which Github.com/russellhaering/gosaml2 versions are affected?
Affected versions include releases prior to 0.9.0 across affected packages: github.com/russellhaering/gosaml2.
What version fixes CVE-2023-26483?
Upgrading to 0.9.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.9.0. Upgrade your dependency to 0.9.0 or later.
What is the CVSS score of CVE-2023-26483?
CVE-2023-26483 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2023-26483?
CVE-2023-26483 is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification) (The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.).
How can I check Go dependencies for CVE-2023-26483?
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-6gc3-crp7-25w5",
  "modified" : "2024-05-20T21:49:09Z",
  "published" : "2023-03-02T23:12:47Z",
  "aliases" : [ "CVE-2023-26483" ],
  "summary" : "gosaml2 vulnerable to Denial Of Service Via Deflate Decompression Bomb",
  "details" : "### Impact\nSAML 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.\n\n### Mitigation\nThe 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\".\n\nImplementors are encouraged not to rely on this.\n\n### Patches\nThis issue is addressed in v0.9.0",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/russellhaering/gosaml2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.9.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/russellhaering/gosaml2/security/advisories/GHSA-6gc3-crp7-25w5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-26483"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/russellhaering/gosaml2/commit/f9d66040241093e8702649baff50cc70d2c683c0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/russellhaering/gosaml2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/russellhaering/gosaml2/releases/tag/v0.9.0"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2023-1602"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-409" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-02T23:12:47Z",
    "nvd_published_at" : "2023-03-03T23:15:00Z"
  }
}