CVE-2026-107853: tiny-secp256k1: Stale buffer after ignored wasm failure accepts invalid infinity tweak
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 XONLYPUBLICKEYINPUT 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/tiny-secp256k1to a version that resolves this vulnerability.Fixed in 2.2.5 - Upgrade
Upgrade
npm/@bitcoin-js/tiny-secp256k1-asmjsto a version that resolves this vulnerability.Fixed in 2.2.5
Event History
Frequently Asked Questions
Which package versions need remediation?
tiny-secp256k1 is affected from 2.1.0 through versions before 2.2.5. @bitcoin-js/tiny-secp256k1-asmjs is affected from 2.2.2 through versions before 2.2.5; version 2.2.5 fixes the issue.
What inputs must an attacker control to trigger the validation bypass?
The affected three-argument xOnlyPointAddTweakCheck path must process a tweak that produces the point at infinity. The attacker also needs to supply a resultToCheck equal to the original internal point left in the shared buffer.
How can we determine whether our application is exposed?
Check whether an affected package version is installed and whether the application uses the three-argument xOnlyPointAddTweakCheck helper to validate caller-controlled internal keys, tweaks, and comparison values. Protocols using that validation pattern can accept an invalid derived key.
What should be done if an immediate upgrade is not possible?
Do not rely on the affected helper to validate caller-controlled internal keys, tweaks, and comparison values. Ensure validation rejects tweak operations that fail because they produce the point at infinity.