# CVE-2023-26483: gosaml2 vulnerable to Denial of Service via deflate decompression bomb

> Attackers can cause denial of service in SAML Service Providers using gosaml2 by sending compressed requests that exhaust memory.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Mar 2023
- **Updated:** 25 Feb 2025
- **Also known as:** GHSA-6gc3-crp7-25w5, GO-2023-1602

## What is CVE-2023-26483?

CVE-2023-26483 is a medium-severity denial of service vulnerability in russellhaering gosaml2, published on 3 Mar 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

gosaml2 is a Pure Go implementation of SAML 2.0. 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. 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. This issue is fixed  in version 0.9.0.

Weakness: CWE-409 (Improper Handling of Highly Compressed Data (Data Amplification))

## Which versions are affected by CVE-2023-26483?

3 open source packages ship an affected version, including github.com/russellhaering/gosaml2. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/russellhaering/gosaml2` | Go | All versions | 0.9.0 |
| `github.com/russellhaering/gosaml2` | Go | All versions | 0.9.0 |
| `github.com/russellhaering/gosaml2` | Go | All versions | 0.9.0 |

Products: Gosaml2 Project Gosaml2.

## How do I fix CVE-2023-26483?

Upgrade github.com/russellhaering/gosaml2 to 0.9.0 or later.

## Is CVE-2023-26483 being exploited?

There is no known exploitation of CVE-2023-26483 in the wild and no public exploit code.

## Other vulnerabilities in russellhaering gosaml2

- [CVE-2020-7731](https://insights.sbomify.com/CVE-2020-7731/): Denial of Service (DoS) (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-26483 and fix it if it is affected.

What it is: CVE-2023-26483 is a medium-severity denial of service vulnerability in russellhaering gosaml2, published on 3 Mar 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-26483 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/russellhaering/gosaml2 (Go): affected all versions; fixed in 0.9.0
- github.com/russellhaering/gosaml2 (Go): affected all versions; fixed in 0.9.0
- github.com/russellhaering/gosaml2 (Go): affected all versions; fixed in 0.9.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-26483/ (Markdown: https://insights.sbomify.com/CVE-2023-26483/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-26483
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-26483
- OSV: https://osv.dev/vulnerability/CVE-2023-26483

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-26483/
Summaries are generated and may contain mistakes; the official description above is the record.
