Timing leak in secp256k1-native constant-time scalar multiplication
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-208.
Summary
secp256k1-native from 0.17.0 before 0.18.0 is a native C secp256k1 implementation for Ruby. When built with GCC at -O2, the compiler turns the branchless selection in the Montgomery ladder used by constant-time scalar multiplication into a secret-dependent branch (CWE-208). An attacker who can observe the timing of a multiplication with a secret private key or nonce can statistically recover scalar bits through repeated measurements.
Written with Claude Haiku 5.5 from the sources below · 2026-11-02
Description from the CNA
secp256k1-native is a native C secp256k1 implementation for Ruby. In affected native builds, native constant-time scalar multiplication through `Point#mul` or `scalar_multiply_ct` can leak timing information about a secret scalar when compiled by a toolchain that reconstructs branchless selection into a branch. The `Montgomery ladder` uses `uint256_select` with an all-zeros or all-ones mask, but affected GCC builds at `-O2` recover the original condition and emit secret-dependent `je` or `jne` jumps whose timing correlates with scalar bits. This defeats the assumption behind the 0.17.0 `jp_add_internal` infinity-branch fix. A consumer must multiply a secret private key or nonce in a context where an attacker can observe timing; repeated measurements can statistically recover scalar bits. The defect is in the compiled binary, so source review or `ctgrind` on a non-reconstructing toolchain may miss it. GCC 14.3.0, 15.1.0, and 15.2.0 reproduced the branch reconstruction, and `extconf.rb` appends `-O2`. Tested GCC versions through 12.4.0 used bitwise operations and GCC 13.3.0 used constant-time `cmov`; the pure-Ruby path is not affected by this flaw and separately makes no constant-time claim. GCC 16 and clang were untested, and point releases, targets, and flag combinations were not exhaustively bisected. `Earlier pre-0.17.0 versions had different constant-time issues rather than this introduced select idiom.` Version 0.18.0 contains the verified fix. The advisory's broad pre-0.18.0 guidance also covers earlier, different constant-time issues; whether this CVE groups those issues or only the select idiom introduced in 0.17.0 remains unresolved.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
Remediation
Upgrade secp256k1-native to version 0.18.0, which contains the verified fix.
Written with Claude Haiku 5.5 from the sources below · 2026-11-02
- Fix · CNA secp256k1-native (sgbett) Fixed in 0.18.0
Timeline
- 2026-10-30 Threatist record created from CVE-2026-63410
- 2026-11-01 Priority changed: MEDIUM → LOW
- 2026-11-02 CISA SSVC decision points changed
- 2026-11-02 Priority changed: LOW → MEDIUM
References
Other 5
- https://github.com/sgbett/secp256k1-native/security/advisories/GHSA-vp2j-gqfm-r3cf
- https://github.com/sgbett/secp256k1-native/pull/32
- https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e
- https://github.com/sgbett/secp256k1-native/blob/master/docs/advisories/0001-compiler-reconstructed-ct-branch.md
- https://github.com/sgbett/secp256k1-native/releases/tag/v0.18.0
More sgbett vulnerabilities
- TI-2026-28901 bsv-sdk and bsv-wallet persist unverified certifier signatures in acquire_certificate (direct and issuance paths) CVSS 3.1HIGH 8.1
- TI-2026-28900 bsv-sdk ARC broadcaster treats INVALID/MALFORMED/ORPHAN responses as successful broadcasts CVSS 3.1HIGH 7.5
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences