# CVE-2025-22149: JWK Set's HTTP client only overwrites and appends JWK to local cache during refresh

> Attackers can bypass key revocation in the JWK Set Go library's auto-caching client because stale keys are not removed from the local cache.

- **Severity:** Low 2.1 (`CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Jan 2025
- **Updated:** 23 May 2025
- **Also known as:** GHSA-675f-rq2r-jw82, GO-2025-3376

## What is CVE-2025-22149?

CVE-2025-22149 is a low-severity vulnerability in MicahParks jwkset, published on 9 Jan 2025. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

JWK Set (JSON Web Key Set) is a JWK and JWK Set Go implementation. Prior to 0.6.0, the project's provided HTTP client's local JWK Set cache should do a full replacement when the goroutine refreshes the remote JWK Set. The current behavior is to overwrite or append. This is a security issue for use cases that utilize the provided auto-caching HTTP client and where key removal from a JWK Set is equivalent to revocation. The affected auto-caching HTTP client was added in version v0.5.0 and fixed in v0.6.0. The only workaround would be to remove the provided auto-caching HTTP client and replace it with a custom implementation. This involves setting the HTTPClientStorageOptions.RefreshInterval to zero (or not specifying the value).

Weakness: CWE-672 (Operation on a Resource after Expiration or Release)

## Which versions are affected by CVE-2025-22149?

3 open source packages ship an affected version, including github.com/MicahParks/jwkset.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/MicahParks/jwkset` | Go | From 0.5.0 | 0.6.0 |
| `github.com/MicahParks/jwkset` | Go | From 0.5.0 | 0.6.0 |
| `github.com/MicahParks/jwkset` | Go | From 0.5.0 | 0.6.0 |

## How do I fix CVE-2025-22149?

Upgrade github.com/MicahParks/jwkset to 0.6.0 or later.

## Is CVE-2025-22149 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-22149 and fix it if it is affected.

What it is: CVE-2025-22149 is a low-severity vulnerability in MicahParks jwkset, published on 9 Jan 2025. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-22149 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/MicahParks/jwkset (Go): affected from 0.5.0; fixed in 0.6.0
- github.com/MicahParks/jwkset (Go): affected from 0.5.0; fixed in 0.6.0
- github.com/MicahParks/jwkset (Go): affected from 0.5.0; fixed in 0.6.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-2025-22149/ (Markdown: https://insights.sbomify.com/CVE-2025-22149/index.md)
```

## Sources

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

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