# CVE-2020-5261: Missing Token Replay Detection

> Attackers can replay SAML tokens to bypass authentication and take over user accounts in applications using the Sustainsys.Saml2 library.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Mar 2020
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-g6j2-ch25-5mmv

## What is CVE-2020-5261?

CVE-2020-5261 is a high-severity authentication bypass vulnerability in Sustainsys Saml2, published on 25 Mar 2020. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Saml2 Authentication services for ASP.NET (NuGet package Sustainsys.Saml2) greater than 2.0.0, and less than version 2.5.0 has a faulty implementation of Token Replay Detection. Token Replay Detection is an important defence in depth measure for Single Sign On solutions. The 2.5.0 version is patched. Note that version 1.0.1 is not affected. It has a correct Token Replay Implementation and is safe to use. Saml2 Authentication services for ASP.NET (NuGet package Sustainsys.Saml2) greater than 2.0.0, and less than version 2.5.0 have a faulty implementation of Token Replay Detection. Token Replay Detection is an important defense measure for Single Sign On solutions. The 2.5.0 version is patched. Note that version 1.0.1 and prior versions are not affected. These versions have a correct Token Replay Implementation and are safe to use.

Weakness: CWE-294 (Authentication Bypass by Capture-replay)

## Which versions are affected by CVE-2020-5261?

2 open source packages ship an affected version, including Sustainsys.Saml2. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `Sustainsys.Saml2` | NuGet | From 2.0.0 | 2.5.0 |
| `Sustainsys.Saml2` | NuGet | From 2.0.0 | 2.5.0 |

Products: Sustainsys Saml2.

## How do I fix CVE-2020-5261?

Upgrade Sustainsys.Saml2 to 2.5.0 or later.

## Is CVE-2020-5261 being exploited?

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

## Other vulnerabilities in Sustainsys Saml2

- [CVE-2023-41890](https://insights.sbomify.com/CVE-2023-41890/): Sustainsys.Saml2 Insufficient Identity Provider Issuer Validation (high 7.5)
- [CVE-2020-5268](https://insights.sbomify.com/CVE-2020-5268/): Subject Confirmation Method not validated in Saml2 Authentication Services for ASP.NET (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-5261 and fix it if it is affected.

What it is: CVE-2020-5261 is a high-severity authentication bypass vulnerability in Sustainsys Saml2, published on 25 Mar 2020. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2020-5261 in the wild and no public exploit code.

Affected packages and fixed versions:
- Sustainsys.Saml2 (NuGet): affected from 2.0.0; fixed in 2.5.0
- Sustainsys.Saml2 (NuGet): affected from 2.0.0; fixed in 2.5.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-2020-5261/ (Markdown: https://insights.sbomify.com/CVE-2020-5261/index.md)
```

## Sources

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

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