npm
CVE-2026-107853
tiny-secp256k1: Stale buffer after ignored wasm failure accepts invalid infinity tweak
- Severity
- Medium
- Published
- 19 Nov 2026
- Last changed
- 19 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 2.2.5
- Exploit chance
- 0.4% in the next 30 daysHigher than 38% of CVEs. EPSS by FIRST, 24 Nov 2026
- Weakness
- CWE-252
- Also known as
- GHSA-hj9c-qx2w-g7mh
- Sources
- OSV.dev and GitHub
Description
The three-argument xOnlyPointAddTweakCheck path ignores the wasm failure return and compares an unchanged input buffer. When the tweak result is the point at infinity, this stale-buffer comparison can return true for an invalid derivation.
xOnlyPointAddTweakCheck in index.ts has two code paths. The path taken when the caller omits tweakParity discards the return value of the wasm call and compares whatever the shared input buffer holds.
x_only_point_add_tweak in lib.rs returns -1 and leaves X_ONLY_PUBLIC_KEY_INPUT untouched when the tweak addition fails.
The buffer still holds point, which the caller wrote immediately before the call. newKey therefore equals point, and the comparison against resultToCheck succeeds whenever the caller passes resultToCheck equal to point.
secp256k1_xonly_pubkey_tweak_add in upstream main_impl.h returns 0 only when the internal key fails to load or the tweak helper fails.
The helper in secp256k1.c fails on scalar overflow or on an infinite result.
Affected software
| Software | Affected versions |
|---|---|
@bitcoin-js/tiny-secp256k1-asmjsnpm · osv:npm:@bitcoin-js/tiny-secp256k1-asmjs |
|
tiny-secp256k1npm · osv:npm:tiny-secp256k1 |
|
About @bitcoin-js/tiny-secp256k1-asmjs
- Weekly downloads (npm)
- 108,442npm, 24 Nov 2026
This is the only vulnerability in @bitcoin-js/tiny-secp256k1-asmjs in our list.
About tiny-secp256k1
- Weekly downloads (npm)
- 726,894npm, 24 Nov 2026
This is the only vulnerability in tiny-secp256k1 in our list.
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-107853
- GitHub Advisory Database https://github.com/advisories/GHSA-hj9c-qx2w-g7mh