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.