CVE-2026-65630

Timing side-channel in pure-Erlang X25519 scalar multiplication leaks the private key in jose

Published Oct 26, 2026 CVSS 4.0 · 5.9 Medium EPSS < 1% KEV · Not listed
Description
Observable Timing Discrepancy vulnerability in potatosalad jose allows recovery of a long-term X25519 private key through a timing side channel in the pure-Erlang Curve25519 fallback.

The pure-Erlang X25519 implementation performs scalar multiplication over the secret private key using a recursive Montgomery ladder (jose_jwa_x25519:curve25519/2) whose clauses branch on individual bits of the clamped private scalar, and whose per-step operations (jose_jwa_x25519:montgomery_add/3 and jose_jwa_x25519:montgomery_double/1) and field inversion are built from value-dependent Erlang bignum arithmetic (multiplication, remainder, and modular exponentiation). Although the ladder is operation-count balanced and fixed at 254 steps, the concrete integer values processed at each step, and therefore the running time, depend on the secret scalar. The execution time of the public entry points jose_jwa_x25519:scalarmult/2, jose_jwa_x25519:x25519/2, jose_jwa_x25519:x25519_base/1, and jose_jwa_x25519:sk_to_pk/1 is thus a function of the private key.

This path is reachable from the public API, most notably when a service decrypts attacker-supplied ECDH-ES (JWE) messages with a long-term X25519 key (for example through JOSE.JWK.box_decrypt_ecdh_es/2, which reaches jose_jwa_curve25519:x25519_shared_secret/2 and the ladder). An attacker who can submit ciphertexts and measure decryption timing can, in principle, recover the private key bit by bit, defeating the resistance X25519 was designed to provide. Recovery of the key compromises the confidentiality and authenticity of all data protected by it.

This issue affects jose: from 1.10.0 before 1.11.13.

Analysis

AI-generated

Technical impact

The vulnerability is a timing side‑channel in the pure‑Erlang implementation of X25519 scalar multiplication in the jose library. The algorithm uses a recursive Montgomery ladder whose internal arithmetic operations depend on the binary representation of the secret scalar, causing measurable variations in execution time. This allows an attacker who can trigger the public decryption API and measure its latency to recover the long‑term private key bit by bit, violating the confidentiality guarantees of X25519.

Affected Systems

The issue affects the potatosalad jose library, versions starting at 1.10.0 up to, but not including, 1.11.13. Versions prior to 1.10.0 do not contain the pure‑Erlang fallback and are therefore not impacted.

Risk and Exploitability

The CVSS base score of 5.9 indicates moderate severity, while the EPSS score is not available and the vulnerability is not listed in the CISA KEV catalog. The attack vector is inferred to be a remote timing attack where an adversary submits ciphertexts to a service that performs JWE decryption and measures the response time. With sufficient timing samples, the attacker can reconstruct the private key, thereby compromising all data protected by that key. The overall risk is considered moderate but non‑negligible, especially for systems that rely on long‑term keys and expose the decryption API to potential attackers.

Remediation

Vendor Workaround

Use a constant-time native X25519 implementation for private-key operations: install the libsodium or libdecaf NIF, or run on an OTP release whose crypto application provides x25519, and do not force the pure-Erlang Curve25519 fallback (JOSE.crypto_fallback(true) or JOSE.curve25519_module(:jose_jwa_curve25519)) for long-lived keys.


OpenCVE Recommended Actions

  • Upgrade the jose library to version 1.11.13 or later to obtain a constant‑time native X25519 implementation.
  • If upgrading is not yet possible, install a native X25519 NIF such as libsodium or libdecaf and configure JOSE to use it for private‑key operations.
  • Ensure that the pure‑Erlang Curve25519 fallback is never enabled for long‑term keys by disabling JOSE.crypto_fallback(true) and/or JOSE.curve25519_module(:jose_jwa_curve25519).

Generated by OpenCVE AI on October 27, 2026 at 01:07 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 Observable Timing Discrepancy vulnerability in potatosalad jose allows recovery of a long-term X25519 private key through a timing side channel in the pure-Erlang Curve25519 fallback. The pure-Erlang X25519 implementation performs scalar multiplication over the secret private key using a recursive Montgomery ladder (jose_jwa_x25519:curve25519/2) whose clauses branch on individual bits of the clamped private scalar, and whose per-step operations (jose_jwa_x25519:montgomery_add/3 and jose_jwa_x25519:montgomery_double/1) and field inversion are built from value-dependent Erlang bignum arithmetic (multiplication, remainder, and modular exponentiation). Although the ladder is operation-count balanced and fixed at 254 steps, the concrete integer values processed at each step, and therefore the running time, depend on the secret scalar. The execution time of the public entry points jose_jwa_x25519:scalarmult/2, jose_jwa_x25519:x25519/2, jose_jwa_x25519:x25519_base/1, and jose_jwa_x25519:sk_to_pk/1 is thus a function of the private key. This path is reachable from the public API, most notably when a service decrypts attacker-supplied ECDH-ES (JWE) messages with a long-term X25519 key (for example through JOSE.JWK.box_decrypt_ecdh_es/2, which reaches jose_jwa_curve25519:x25519_shared_secret/2 and the ladder). An attacker who can submit ciphertexts and measure decryption timing can, in principle, recover the private key bit by bit, defeating the resistance X25519 was designed to provide. Recovery of the key compromises the confidentiality and authenticity of all data protected by it. This issue affects jose: from 1.10.0 before 1.11.13.
Title Timing side-channel in pure-Erlang X25519 scalar multiplication leaks the private key in jose
First Time appeared Potatosalad
Potatosalad jose
Weaknesses CWE-208
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:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-208

    Observable Timing Discrepancy

Sources

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