Security
CVE-2026-63410: GCC -O2 rebuilds secp256k1-native's branchless select into secret-dependent jumps, leaking scalar bits
A published advisory reports that affected GCC builds at -O2 reconstruct secp256k1-native's masked uint256_select into secret-dependent je/jne branches, allowing timing measurements to statistically recover scalar bits. Version 0.18.0 contains the verified fix.
A vulnerability tracked as CVE-2026-63410 affects secp256k1-native, described in the advisory as a native C secp256k1 implementation for Ruby. According to the advisory, 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 advisory states that 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. It says this defeats the assumption behind the 0.17.0 jp_add_internal infinity-branch fix. Exploitation requires a consumer to multiply a secret private key or nonce in a context where an attacker can observe timing. The advisory says repeated measurements can statistically recover scalar bits.
Because the defect is in the compiled binary, the advisory notes that source review or ctgrind on a non-reconstructing toolchain may miss it. It reports that GCC 14.3.0, 15.1.0, and 15.2.0 reproduced the branch reconstruction, and that extconf.rb appends -O2. Tested GCC versions through 12.4.0 used bitwise operations and GCC 13.3.0 used constant-time cmov, according to the advisory. It states that 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.
The advisory says earlier pre-0.17.0 versions had different constant-time issues rather than this introduced select idiom, and that version 0.18.0 contains the verified fix. It adds that the advisory's broad pre-0.18.0 guidance also covers earlier, different constant-time issues, and that whether this CVE groups those issues or only the select idiom introduced in 0.17.0 remains unresolved.
The CVE record lists a CVSS 3.1 score of MEDIUM from MITRE-CVE and marks the vulnerability as remotely exploitable. The listed solution is to update to secp256k1-native version 0.18.0 or later, ensure the toolchain does not reconstruct branchless code, and avoid secret key timing observations. The record was published on Oct. 30, 2026, at 11:17 p.m.
Analysis: For teams building AI agents that sign or hold keys in Ruby, constant-timeness has to be verified on the emitted binary for the exact compiler and flags used, not inferred from the C source or from a different toolchain's test run.
Claims and evidence
What the author claims, and what backs it up. Key claims are the ones the story depends on.
-
CVE-2026-63410 affects secp256k1-native, a native C secp256k1 implementation for Ruby.
Key claim
Supported
-
quote
https://cvefeed.io/vuln/detail/CVE-2026-63410“secp256k1-native is a native C secp256k1 implementation for Ruby.”
-
quote
-
Affected GCC builds at -O2 recover the original condition in uint256_select and emit secret-dependent je or jne jumps whose timing correlates with scalar bits.
Key claim
Supported
-
quote
https://cvefeed.io/vuln/detail/CVE-2026-63410“affected GCC builds at `-O2` recover the original condition and emit secret-dependent `je` or `jne` jumps whose timing correlates with scalar bits.”
-
quote
-
The branch reconstruction defeats the assumption behind the 0.17.0 jp_add_internal infinity-branch fix.
Key claim
Supported
-
quote
https://cvefeed.io/vuln/detail/CVE-2026-63410“This defeats the assumption behind the 0.17.0 `jp_add_internal` infinity-branch fix.”
-
quote
-
GCC 14.3.0, 15.1.0, and 15.2.0 reproduced the branch reconstruction, and extconf.rb appends -O2.
Key claim
Supported
-
quote
https://cvefeed.io/vuln/detail/CVE-2026-63410“GCC 14.3.0, 15.1.0, and 15.2.0 reproduced the branch reconstruction, and `extconf.rb` appends `-O2`.”
-
quote
-
Version 0.18.0 of secp256k1-native contains the verified fix.
Key claim
Supported
-
quote
https://cvefeed.io/vuln/detail/CVE-2026-63410“Version 0.18.0 contains the verified fix.”
-
quote
-
The pure-Ruby path is not affected by this flaw and separately makes no constant-time claim.
Key claim
Supported
-
quote
https://cvefeed.io/vuln/detail/CVE-2026-63410“the pure-Ruby path is not affected by this flaw and separately makes no constant-time claim.”
-
quote
-
The CVE record was published on Oct. 30, 2026, at 11:17 p.m.
Supported
-
quote
https://cvefeed.io/vuln/detail/CVE-2026-63410“Published Date : Oct. 30, 2026, 11:17 p.m.”
-
quote