# CVE-2026-65628: Infinite recursion (CPU denial-of-service) in JOSE.JWK.shared_secret/2 on mismatched key types

Status: published. Published: 2026-10-26. Updated: 2026-11-02.

jose_jwk:shared_secret/2 (exposed in Elixir as JOSE.JWK.shared_secret/2) derives an ECDH shared secret from two JWKs. Its first function clause only matches when both JWKs carry the same key type (kty) module, and its fallback clause re-invokes itself as shared_secret(from(YourJWK), from(MyJWK)). Because from/1 returns an already-parsed jose_jwk record unchanged, passing two JWKs whose key types differ (for example an EC key and an RSA key) makes the fallback clause re-enter with identical arguments, producing an unbounded tail-recursive loop that never returns and never crashes.

An application that derives a shared secret from an externally supplied peer public key without first checking that the peer key's type and curve match its own key can be driven into this loop by an attacker-controlled JWK, pinning an Erlang scheduler at 100% CPU. Repeated requests exhaust the available schedulers, resulting in a denial of service.

This issue affects jose: from 1.5.0 before 1.11.13.

## Remediation

- workaround: Before calling JOSE.JWK.shared_secret/2, verify that the externally supplied peer key's type (kty) and curve match your own key, and reject any key whose type does not match before attempting derivation. (source: CNA: EEF)
- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: CNA: EEF) — https://github.com/potatosalad/erlang-jose/commit/26182a7de63b91550035d3f08741f7d17f1f675a

## Affected products and versions

- potatosalad / jose (jose): ≥ 1.5.0; < 1.11.13 (affected, semver). Source: CNA: EEF
- potatosalad / jose (potatosalad/erlang-jose): ≥ 7b80b9f55b9898e1a6901ce136061b241b021d7c; < 26182a7de63b91550035d3f08741f7d17f1f675a (affected, git). Source: CNA: EEF

## Severity and prioritization

- CVSS 4.0: 5.9 (medium); CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N; source: CNA: EEF

- CVSS 4.0: 5.9 (medium); CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X; source: NVD: 6b3ad84c-e1a6-4bf7-a703-f496b71e49db

- CISA KEV: No listing in collected sources

- EPSS: 0.14% as of 2026-11-02; percentile 3.02%

- SSVC: exploitation poc; automatable no; technical impact partial; source ADP: CISA-ADP

- Weaknesses: CWE-674

## Exploit evidence

- exploit: https://github.com/potatosalad/erlang-jose/security/advisories/GHSA-fpj2-9h59-32pp (ADP: CISA-ADP)

## References

- https://github.com/potatosalad/erlang-jose/security/advisories/GHSA-fpj2-9h59-32pp (CNA: EEF; vendor-advisory, related)

- https://cna.erlef.org/cves/CVE-2026-65628.html (CNA: EEF; related)

- https://osv.dev/vulnerability/EEF-CVE-2026-65628 (CNA: EEF; related)

- https://github.com/potatosalad/erlang-jose/commit/7b80b9f55b9898e1a6901ce136061b241b021d7c (CNA: EEF; related)

- https://github.com/potatosalad/erlang-jose/commit/26182a7de63b91550035d3f08741f7d17f1f675a (CNA: EEF; patch)

- https://github.com/potatosalad/erlang-jose/security/advisories/GHSA-fpj2-9h59-32pp (ADP: CISA-ADP; exploit)

- https://cna.erlef.org/cves/CVE-2026-65628.html (6b3ad84c-e1a6-4bf7-a703-f496b71e49db)

- https://github.com/potatosalad/erlang-jose/commit/26182a7de63b91550035d3f08741f7d17f1f675a (6b3ad84c-e1a6-4bf7-a703-f496b71e49db)

- https://github.com/potatosalad/erlang-jose/commit/7b80b9f55b9898e1a6901ce136061b241b021d7c (6b3ad84c-e1a6-4bf7-a703-f496b71e49db)

- https://github.com/potatosalad/erlang-jose/security/advisories/GHSA-fpj2-9h59-32pp (6b3ad84c-e1a6-4bf7-a703-f496b71e49db)

- https://osv.dev/vulnerability/EEF-CVE-2026-65628 (6b3ad84c-e1a6-4bf7-a703-f496b71e49db)

- https://github.com/potatosalad/erlang-jose/security/advisories/GHSA-fpj2-9h59-32pp (134c704f-9b21-4f2e-91b3-4a467353bcc0)

## Provenance

- CNA: EEF: https://www.cve.org/CVERecord?id=CVE-2026-65628; retrieved 2026-11-02; source updated 2026-11-02

- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-65628; retrieved 2026-11-03; source updated 2026-11-02

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-65628; retrieved 2026-11-02; source updated Not reported

Revision: 39cbb3d4ee6fe7ba259f1d2f6e232f068256734ae338484f268659261e3fad80

Canonical: https://y2.dev/cve/CVE-2026-65628

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.