# CVE-2020-15222: Replay of private_key_jwt possible in ORY Fosite

> Attackers can replay private_key_jwt assertions in ORY Fosite due to missing jti uniqueness checks, bypassing authentication protections.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 24 Sep 2020
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-v3q9-2p3m-7g43, GO-2021-0110

## What is CVE-2020-15222?

CVE-2020-15222 is a high-severity vulnerability in ory fosite, published on 24 Sep 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

In ORY Fosite (the security first OAuth2 & OpenID Connect framework for Go) before version 0.31.0, when using "private_key_jwt" authentication the uniqueness of the `jti` value is not checked. When using client authentication method "private_key_jwt", OpenId specification says the following about assertion `jti`: "A unique identifier for the token, which can be used to prevent reuse of the token. These tokens MUST only be used once, unless conditions for reuse were negotiated between the parties". Hydra does not seem to check the uniqueness of this `jti` value. This problem is fixed in version 0.31.0.

Weakness: CWE-345 (Insufficient Verification of Data Authenticity), CWE-287 (Improper Authentication)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/ory/fosite` | Go | All versions | 0.31.0 |
| `github.com/ory/fosite` | Go | All versions | 0.31.0 |
| `github.com/ory/fosite` | Go | All versions | 0.31.0 |

Products: Ory Fosite.

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

Upgrade github.com/ory/fosite to 0.31.0 or later.

## Is CVE-2020-15222 being exploited?

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

## Other vulnerabilities in ory fosite

- [CVE-2020-15223](https://insights.sbomify.com/CVE-2020-15223/): Ignored storage errors on token revokation in ORY Fosite (high 8.0)
- [CVE-2020-15233](https://insights.sbomify.com/CVE-2020-15233/): OAuth2 Redirect URL validity does not respect query parameters and character casing for loopback addresses (medium 6.1)
- [CVE-2020-15234](https://insights.sbomify.com/CVE-2020-15234/): Redirect URL matching ignores character casing (medium 6.1)

## Fix prompt for AI coding agents

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

What it is: CVE-2020-15222 is a high-severity vulnerability in ory fosite, published on 24 Sep 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2020-15222 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/ory/fosite (Go): affected all versions; fixed in 0.31.0
- github.com/ory/fosite (Go): affected all versions; fixed in 0.31.0
- github.com/ory/fosite (Go): affected all versions; fixed in 0.31.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-15222/ (Markdown: https://insights.sbomify.com/CVE-2020-15222/index.md)
```

## Sources

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

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