CVE-2026-107853

tiny-secp256k1: Stale buffer after ignored wasm failure accepts invalid infinity tweak

Published Nov 17, 2026 CVSS 4.0 · 6.3 Medium EPSS n/a KEV · Not listed
Description
tiny-secp256k1 is a tiny secp256k1 native/JS wrapper. From 2.1.0 until 2.2.5 for tiny-secp256k1 and from 2.2.2 until 2.2.5 for @bitcoin-js/tiny-secp256k1-asmjs, the three-argument xOnlyPointAddTweakCheck path ignores the backend failure return from xOnlyPointAddTweak when a tweak produces the point at infinity. The shared X_ONLY_PUBLIC_KEY_INPUT buffer then still contains the original point, so a caller-controlled resultToCheck equal to that point can make the stale-buffer comparison return true even though no tweaked key exists. Protocols that rely on this helper to validate caller-controlled internal keys, tweaks, and comparison values can accept an invalid derived key. This issue is fixed in version 2.2.5.

Analysis

AI-generated

Technical impact

A flaw in the tiny‑secp256k1 wrapper allows a function that performs a tweak of an X‑only public key to ignore a backend failure when that tweak would produce the point at infinity. Because the shared buffer that holds the original key is not cleared, a caller can provide a second key that matches the stale value, causing the integrity check to succeed even though no valid tweaked key exists. The weakness is an unchecked return value (CWE‑252). The practical impact is that protocols that rely on this helper to validate caller‑controlled tweak values can be tricked into accepting an invalid derived key, potentially enabling the forgery of signatures or unauthorized use of cryptographic keys.

Affected Systems

Affected vendors are bitcoinjs and @bitcoin-js. The buggy library is tiny‑secp256k1 for versions 2.1.0 through 2.2.5, and @bitcoin-js/tiny‑secp256k1‑asmjs for versions 2.2.2 through 2.2.5. The issue is fixed in version 2.2.5 of both packages.

Risk and Exploitability

The CVSS score of 6.3 indicates a medium‑severity flaw. No EPSS score is available and the vulnerability is not listed in CISA’s KEV catalog, so widespread exploitation has not been observed. The vulnerability can be exploited only through code that calls the vulnerable xOnlyPointAddTweakCheck API, so the attack vector is local to the application. An attacker who can supply a tweak that forces the point at infinity would cause the function to ignore the failure and leave the key buffer unchanged. By then providing a comparison value that matches the stale buffer, the function may falsely return success, allowing the use of an invalid derived key. This could compromise integrity and authenticity in protocols that depend on the helper.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update tiny‑secp256k1 and @bitcoin‑js/tiny‑secp256k1‑asmjs to version 2.2.5 or later.
  • Ensure that your code uses the patched implementation of xOnlyPointAddTweakCheck and performs an explicit check that a tweak does not result in a point at infinity before calling the function.
  • If an immediate upgrade is infeasible, avoid calling xOnlyPointAddTweakCheck with untrusted tweak values; instead validate derivation in your own code or use an alternative key‑derivation mechanism.

Generated by OpenCVE AI on November 17, 2026 at 20:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description tiny-secp256k1 is a tiny secp256k1 native/JS wrapper. From 2.1.0 until 2.2.5 for tiny-secp256k1 and from 2.2.2 until 2.2.5 for @bitcoin-js/tiny-secp256k1-asmjs, the three-argument xOnlyPointAddTweakCheck path ignores the backend failure return from xOnlyPointAddTweak when a tweak produces the point at infinity. The shared X_ONLY_PUBLIC_KEY_INPUT buffer then still contains the original point, so a caller-controlled resultToCheck equal to that point can make the stale-buffer comparison return true even though no tweaked key exists. Protocols that rely on this helper to validate caller-controlled internal keys, tweaks, and comparison values can accept an invalid derived key. This issue is fixed in version 2.2.5.
Title tiny-secp256k1: Stale buffer after ignored wasm failure accepts invalid infinity tweak
Weaknesses CWE-252
References
Metrics cvssV4_0

{'score': 6.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N'}

Subscriptions

No data.

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 17, 2026, 7:23 PM
Reserved
Oct 8, 2026, 10:34 PM
Status
Received
Published
Nov 17, 2026, 8:17 PM
Modified
Nov 17, 2026, 8:17 PM