CVE-2026-63410: CVE-2026-63410: Compiler-Induced Timing Side-Channel in secp256k1-native Scalar Multiplication
CVE-2026-63410: Compiler-Induced Timing Side-Channel in secp256k1-native Scalar Multiplication Vulnerability ID: CVE-2026-63410 CVSS Score: 5.9 Published: 2026-11-23 CVE-2026-63410 (GHSA-vp2j-gqfm-r3cf) is a compile
CVE-2026-63410: Compiler-Induced Timing Side-Channel in secp256k1-native Scalar Multiplication
Vulnerability ID: CVE-2026-63410
CVSS Score: 5.9
Published: 2026-11-23
CVE-2026-63410 (GHSA-vp2j-gqfm-r3cf) is a compiler-induced timing side-channel vulnerability in the secp256k1-native Ruby C extension. When compiled with GCC 14.x or 15.x at optimization level -O2, the compiler reconstructs boolean predicates from branchless bitwise multiplexer routines and emits secret-dependent conditional jump instructions (je/jne). During elliptic curve scalar multiplication in the Montgomery ladder, these conditional branches create observable execution timing variations correlated with individual bits of secret private keys or signing nonces.
TL;DR
Aggressive optimization passes in GCC 14 and 15 transform branchless bitwise selection logic in secp256k1-native (>= 0.17.0, < 0.18.0) into secret-dependent conditional jumps, breaking constant-time execution guarantees and enabling private key extraction via statistical timing analysis.
β οΈ Exploit Status: POC
Technical Details
- Vulnerability Type: CWE-208: Observable Timing Discrepancy / CWE-1255: Side-Channel Vulnerability
- Affected Component: secp256k1-native Ruby C Extension (>= 0.17.0, < 0.18.0)
- Trigger Condition: Compilation under GCC 14.x / 15.x at -O2 optimization level
- CVSS v3.1 Score: 5.9 Medium (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N)
- EPSS Score: 0.281% (20.88th Percentile)
- Security Impact: Private key or signing nonce extraction via statistical timing analysis (~560 ns leak)
- Exploit & KEV Status: Verification PoC available (Dudect / ctgrind); Not listed in CISA KEV
- Patched Version: secp256k1-native 0.18.0 (Commit a89bea1617a2d063c6545ad44565dc22098c880e)
Affected Systems
- secp256k1-native Ruby Gem (Native C Extension compiled with GCC 14.x or 15.x at -O2)
-
secp256k1-native: >= 0.17.0, < 0.18.0 (Fixed in:
0.18.0)
Code Analysis
Commit: a89bea1
Introduce ct_value_barrier_u64 and ct_mask_u64 opaque value barriers to prevent GCC 14/15 from reconstructing secret-dependent branches in constant-time selection helpers.
File: ext/secp256k1_native/secp256k1_native.h
@@ -107,11 +107,36 @@ void register_scalar_methods(VALUE mod);
* Branchless selection helper
* ----------------------------------------------------------------------- */
+static inline uint64_t ct_value_barrier_u64(uint64_t x) {
+#if defined(__GNUC__) || defined(__clang__)
+ __asm__ volatile("" : "+r"(x));
+#endif
+ return x;
+}
+
+static inline uint64_t ct_mask_u64(uint64_t flag) {
+ return ct_value_barrier_u64(-(uint64_t)(flag != 0));
+}
+
static inline void uint256_select(uint256_t *r, const uint256_t *a,
const uint256_t *b, uint64_t flag) {
- uint64_t mask = -(uint64_t)(flag != 0);
+ uint64_t mask = ct_mask_u64(flag);
r->d[0] = (a->d[0] & ~mask) | (b->d[0] & mask);
r->d[1] = (a->d[1] & ~mask) | (b->d[1] & mask);
r->d[2] = (a->d[2] & ~mask) | (b->d[2] & mask);
Exploit Details
- GitHub Advisory & Verification Harness: Official technical advisory detailing the Dudect statistical timing harness (|t| ~ 21) and Valgrind ctgrind memory poisoning proof-of-concept demonstrating secret-dependent branching under GCC 14 and 15.
Mitigation Strategies
- Upgrade secp256k1-native to version 0.18.0 or later to incorporate inline assembly value barriers across all constant-time mask generation functions.
- Integrate deterministic secret-poisoning checks (ctgrind via Valgrind Memcheck) into CI/CD pipelines across all supported compiler toolchains.
- Verify compiled production binaries using objdump disassembly inspection to ensure zero conditional branch instructions (je/jne) are emitted in constant-time selection routines.
- Pin build container toolchains to verified compiler versions or lower optimization levels (-O1) if upgrading the gem is temporarily impossible.
Remediation Steps:
- Update the Gemfile to require secp256k1-native >= 0.18.0 and run 'bundle update secp256k1-native' to recompile the native C extension.
- Run the ctgrind test harness ('cd security && make ctgrind && valgrind --tool=memcheck --error-exitcode=1 ./ctgrind_harness') on the build host to confirm zero secret-dependent conditional jumps.
- Audit any cryptographic keys or signatures generated on systems compiled with GCC 14.x or 15.x that were exposed to untrusted network timing measurement, and rotate affected private keys if exposure is suspected.
References
- GitHub Security Advisory GHSA-vp2j-gqfm-r3cf
- Project Technical Advisory: Compiler-reconstructed secret-dependent branch in native scalar multiplication
- Patch Commit a89bea1617a2d063c6545ad44565dc22098c880e
- GitHub Pull Request #32
- secp256k1-native Release v0.18.0
- National Vulnerability Database (NVD) - CVE-2026-63410
- CVE.org Record - CVE-2026-63410
- CVEListV5 JSON Record for CVE-2026-63410
Read the full report for CVE-2026-63410 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.