# CVE-2026-34240: jose vulnerable to untrusted JWK header key acceptance during signature verification

> Attackers can forge valid JWT tokens by embedding their own public key in the header, bypassing signature verification in the JOSE library.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Mar 2026
- **Updated:** 1 Apr 2026
- **Also known as:** GHSA-vm9r-h74p-hg97

## What is CVE-2026-34240?

CVE-2026-34240 is a high-severity authentication bypass vulnerability in appsup-dart jose, published on 31 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

JOSE is a Javascript Object Signing and Encryption (JOSE) library. Prior to version 0.3.5+1, a vulnerability in jose could allow an unauthenticated, remote attacker to forge valid JWS/JWT tokens by using a key embedded in the JOSE header (jwk). The vulnerability exists because key selection could treat header-provided jwk as a verification candidate even when that key was not present in the trusted key store. Since JOSE headers are untrusted input, an attacker could exploit this by creating a token payload, embedding an attacker-controlled public key in the header, and signing with the matching private key. Applications using affected versions for token verification are impacted. This issue has been patched in version 0.3.5+1. A workaround for this issue involves rejecting tokens where header jwk is present unless that jwk matches a key already present in the application's trusted key store.

Weakness: CWE-347 (Improper Verification of Cryptographic Signature)

## Which versions are affected by CVE-2026-34240?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `jose` | Pub | All versions | 0.3.5+1 |
| `jose` | Pub | All versions | 0.3.5+1 |

Products: Appsup-Dart Jose.

## How do I fix CVE-2026-34240?

Upgrade jose to 0.3.5+1 or later.

## Is CVE-2026-34240 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-34240 and fix it if it is affected.

What it is: CVE-2026-34240 is a high-severity authentication bypass vulnerability in appsup-dart jose, published on 31 Mar 2026. 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-2026-34240 in the wild and no public exploit code.

Affected packages and fixed versions:
- jose (Pub): affected all versions; fixed in 0.3.5+1
- jose (Pub): affected all versions; fixed in 0.3.5+1

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

## Sources

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

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