# CVE-2025-59936: get-jwks poisoned JWKS cache allows post-fetch issuer validation bypass

> Attackers can bypass JWT issuer validation by poisoning the JWKS cache, allowing forged tokens to be accepted if validation occurs after key retrieval.

- **Severity:** Critical 9.4 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/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:** 27 Sep 2025
- **Updated:** 29 Sep 2025
- **Also known as:** GHSA-qc2q-qhf3-235m

## What is CVE-2025-59936?

CVE-2025-59936 is a critical authentication bypass vulnerability in nearform get-jwks, published on 27 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

get-jwks contains fetch utils for JWKS keys. In versions prior to 11.0.2, a vulnerability in get-jwks can lead to cache poisoning in the JWKS key-fetching mechanism. When the iss (issuer) claim is validated only after keys are retrieved from the cache, it is possible for cached keys from an unexpected issuer to be reused, resulting in a bypass of issuer validation. This design flaw enables a potential attack where a malicious actor crafts a pair of JWTs, the first one ensuring that a chosen public key is fetched and stored in the shared JWKS cache, and the second one leveraging that cached key to pass signature validation for a targeted iss value. The vulnerability will work only if the iss validation is done after the use of get-jwks for keys retrieval. This issue has been patched in version 11.0.2.

Weakness: CWE-116 (Improper Encoding or Escaping of Output)

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

2 open source packages ship an affected version, including get-jwks.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `get-jwks` | npm | All versions | 11.0.2 |
| `get-jwks` | npm | All versions | 11.0.2 |

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

Upgrade get-jwks to 11.0.2 or later.

## Is CVE-2025-59936 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-59936 exists.

## Fix prompt for AI coding agents

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

What it is: CVE-2025-59936 is a critical authentication bypass vulnerability in nearform get-jwks, published on 27 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-59936 exists.

Affected packages and fixed versions:
- get-jwks (npm): affected all versions; fixed in 11.0.2
- get-jwks (npm): affected all versions; fixed in 11.0.2

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-59936/ (Markdown: https://insights.sbomify.com/CVE-2025-59936/index.md)
```

## Sources

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

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