CVE-2026-65628

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

Published Oct 26, 2026 CVSS 4.0 · 5.9 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability lies in the JOSE.JWK.shared_secret/2 function of the potatosalad jose library. It relies on a fallback clause that re‑invokes the shared_secret function when the key type (kty) differs. The fallback inadvertently causes an unbounded tail recursion when two keys of mismatched types are supplied, leading to infinite recursion. This does not crash but keeps the function running indefinitely, consuming 100% CPU on the scheduler that executes it. As a result, the application can be forced into a CPU denial‑of‑service condition.

Affected Systems

The defect exists in potatosalad jose versions 1.5.0 up to and including 1.11.12. Any application that uses the library to derive a shared secret from an externally supplied JWK without validating the key type and curve before invoking JOSE.JWK.shared_secret/2 is vulnerable. This includes web services, API endpoints, or any module that performs ECDH key agreement with third‑party keys.

Risk and Exploitability

The CVSS base score is 5.9, reflecting a medium impact. EPSS is not listed, so no publicly available probability data, but the bug can be seeded by any attacker that controls the JWK they send to the application. The lack of a KEV listing suggests no widespread documented exploits yet, but the vulnerability surfaces by sending a crafted key that mismatches the server’s key type, causing the infinite recursion to consume a scheduler thread. Consequently, repeated malicious requests can deplete scheduler resources and trigger a denial of service.

Remediation

Vendor 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.


OpenCVE Recommended Actions

  • Upgrade potatosalad jose to version 1.11.13 or later to apply the library fix.
  • If upgrading is not feasible, add explicit validation that the peer key’s kty and curve match your own key before calling JOSE.JWK.shared_secret/2, and reject mismatched keys.
  • Monitor Erlang scheduler usage and consider isolating the shared‑secret routine in a separate process or limiting client requests to mitigate temporary CPU exhaustion.

Generated by OpenCVE AI on October 27, 2026 at 01:18 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title Infinite recursion (CPU denial-of-service) in JOSE.JWK.shared_secret/2 on mismatched key types
First Time appeared Potatosalad
Potatosalad jose
Weaknesses CWE-674
CPEs cpe:2.3:a:potatosalad:jose:*:*:*:*:*:*:*:*
Vendors & Products Potatosalad
Potatosalad jose
References
Metrics cvssV4_0

{'score': 5.9, 'vector': '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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
EEF
Published
Updated
Nov 2, 2026, 9:29 PM
Reserved
Jul 22, 2026, 1:58 PM
Status
Deferred
Published
Oct 26, 2026, 8:17 PM
Modified
Nov 2, 2026, 10:17 PM