Executive brief
tiny-secp256k1 is a cryptographic library used to perform elliptic curve signing operations in JavaScript applications, particularly in Bitcoin and blockchain systems. A vulnerability allows attackers to extract the complete private key by crafting a malicious JSON-stringifyable message and tricking the application into signing it. This compromises the security of any cryptocurrency or digital asset managed with the affected keys.
Technical details
The vulnerability exists in tiny-secp256k1 versions ≤1.1.6 when running in bundled environments where the global Buffer is provided by the npm buffer package (browser bundles, React Native). The issue is a weak input validation check: Buffer.isBuffer() can be bypassed by crafting a JSON-stringifyable object that isn't a true Buffer, causing k (the ephemeral signing key) to be reused across different messages. An attacker can extract the full private key with just two signatures: one on the legitimate message and one on a crafted malicious message. The attack requires the application to sign attacker-controlled messages, which while itself problematic, should not result in total key compromise from a single attack. v2.x is unaffected due to stricter Uint8Array instance verification. A fix is available in version 1.1.7.
Affected products
- bitcoinjs tiny-secp256k1 <=1.1.6
Timeline
- 2025-06-29: disclosed
- 2025-06-29: patched: Fix available in version 1.1.7