Skip to content
Heist/ feed
Back to feed
Medium

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

Type: advisorySources: Official CVE List

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.

Products
jose
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-65628
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 19:51 UTC · Revision 1

Source evidence

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

core-cve · Original source

Published 26 Oct 2026, 19:53 UTC

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.

cve:CVE-2026-65628

jose

Fixed versions: Not specified

jose

Fixed versions: Not specified

Complete source record
{
  "id": "0ad12d53b759b04b088179869794528651448634a7311c0c4d915d84f129e68d",
  "url": "https://www.cve.org/CVERecord?id=CVE-2026-65628",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Infinite recursion (CPU denial-of-service) in JOSE.JWK.shared_secret/2 on mismatched key types",
    "summary": "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.",
    "evidence": "cve:CVE-2026-65628",
    "products": [
      {
        "name": {
          "value": "jose",
          "evidence": "/containers/cna/affected/0/product"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": []
      },
      {
        "name": {
          "value": "jose",
          "evidence": "/containers/cna/affected/1/product"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": []
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-65628",
      "aliases": [
        "CVE-2026-65628"
      ],
      "metrics": [
        {
          "format": "CVSS",
          "cvssV4_0": {
            "Safety": "NOT_DEFINED",
            "version": "4.0",
            "Recovery": "NOT_DEFINED",
            "baseScore": 5.9,
            "Automatable": "NOT_DEFINED",
            "attackVector": "LOCAL",
            "baseSeverity": "MEDIUM",
            "valueDensity": "NOT_DEFINED",
            "vectorString": "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",
            "providerUrgency": "NOT_DEFINED",
            "userInteraction": "NONE",
            "attackComplexity": "LOW",
            "attackRequirements": "PRESENT",
            "privilegesRequired": "NONE",
            "subIntegrityImpact": "NONE",
            "vulnIntegrityImpact": "NONE",
            "subAvailabilityImpact": "NONE",
            "vulnAvailabilityImpact": "HIGH",
            "subConfidentialityImpact": "NONE",
            "vulnConfidentialityImpact": "NONE",
            "vulnerabilityResponseEffort": "NOT_DEFINED"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "affected": [
        {
          "cpes": [
            "cpe:2.3:a:potatosalad:jose:*:*:*:*:*:*:*:*"
          ],
          "repo": "https://github.com/potatosalad/erlang-jose",
          "vendor": "potatosalad",
          "modules": [
            "jose_jwk"
          ],
          "product": "jose",
          "versions": [
            {
              "status": "affected",
              "version": "1.5.0",
              "lessThan": "1.11.13",
              "versionType": "semver"
            }
          ],
          "packageURL": "pkg:hex/jose",
          "packageName": "jose",
          "programFiles": [
            "src/jwk/jose_jwk.erl"
          ],
          "collectionURL": "https://repo.hex.pm",
          "defaultStatus": "unaffected",
          "programRoutines": [
            {
              "name": "jose_jwk:shared_secret/2"
            }
          ]
        },
        {
          "cpes": [
            "cpe:2.3:a:potatosalad:jose:*:*:*:*:*:*:*:*"
          ],
          "repo": "https://github.com/potatosalad/erlang-jose",
          "vendor": "potatosalad",
          "modules": [
            "jose_jwk"
          ],
          "product": "jose",
          "versions": [
            {
              "status": "affected",
              "version": "7b80b9f55b9898e1a6901ce136061b241b021d7c",
              "lessThan": "26182a7de63b91550035d3f08741f7d17f1f675a",
              "versionType": "git"
            }
          ],
          "packageURL": "pkg:github/potatosalad/erlang-jose",
          "packageName": "potatosalad/erlang-jose",
          "programFiles": [
            "src/jwk/jose_jwk.erl"
          ],
          "collectionURL": "https://github.com",
          "defaultStatus": "unaffected",
          "programRoutines": [
            {
              "name": "jose_jwk:shared_secret/2"
            }
          ]
        }
      ],
      "modified": "2026-10-26T19:53:27.625Z",
      "provider": "cve",
      "references": [
        "https://github.com/potatosalad/erlang-jose/security/advisories/GHSA-fpj2-9h59-32pp",
        "https://cna.erlef.org/cves/CVE-2026-65628.html",
        "https://osv.dev/vulnerability/EEF-CVE-2026-65628",
        "https://github.com/potatosalad/erlang-jose/commit/7b80b9f55b9898e1a6901ce136061b241b021d7c",
        "https://github.com/potatosalad/erlang-jose/commit/26182a7de63b91550035d3f08741f7d17f1f675a"
      ],
      "provider_metadata": {
        "cna": {
          "orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
          "shortName": "EEF",
          "dateUpdated": "2026-10-26T19:53:27.625Z"
        }
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-65628",
        "evidence": "/cveMetadata/cveId"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/containers/cna/metrics"
  },
  "source_id": "core-cve",
  "document_id": 338320,
  "published_at": "2026-10-26T19:53:27.625+00:00"
}