{"id":"CVE-2026-63410","summary":"secp256k1-native: Compiler-reconstructed secret-dependent branch in native scalar multiplication","details":"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.","aliases":["GHSA-vp2j-gqfm-r3cf"],"modified":"2026-11-04T07:07:38.587862677Z","published":"2026-10-30T22:48:09.173Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/63xxx/CVE-2026-63410.json","cna_assigner":"GitHub_M","cwe_ids":["CWE-1255","CWE-208"]},"references":[{"type":"WEB","url":"https://github.com/sgbett/secp256k1-native/releases/tag/v0.18.0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/63xxx/CVE-2026-63410.json"},{"type":"ADVISORY","url":"https://github.com/sgbett/secp256k1-native/blob/master/docs/advisories/0001-compiler-reconstructed-ct-branch.md"},{"type":"ADVISORY","url":"https://github.com/sgbett/secp256k1-native/security/advisories/GHSA-vp2j-gqfm-r3cf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63410"},{"type":"FIX","url":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e"},{"type":"FIX","url":"https://github.com/sgbett/secp256k1-native/pull/32"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/sgbett/secp256k1-native","events":[{"introduced":"9387ef3358a9d2b2d7f7bcbe783c13e517c05f37"},{"fixed":"3c3eda6186141cc87445d0ae83f9fecad95a2e69"},{"fixed":"a89bea1617a2d063c6545ad44565dc22098c880e"}],"database_specific":{"extracted_events":[{"strategy":"StringRangeExpression","range":[{"introduced":"0.17.0"},{"fixed":"0.18.0"}],"source":"AFFECTED_FIELD"},{"range":[{"fixed":"a89bea1617a2d063c6545ad44565dc22098c880e"}],"source":"REFERENCES_COMMIT"},{"original_tag":"v0.18.0","range":[{"fixed":"3c3eda6186141cc87445d0ae83f9fecad95a2e69"}],"source":"REFERENCES_TAG"}]}}],"versions":["v0.17.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-63410.json","vanir_signatures":[{"deprecated":false,"digest":{"function_hash":"337212945564847007161009331517032703501","length":391},"id":"CVE-2026-63410-05b83c52","signature_type":"Function","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"file":"ext/secp256k1_native/field.c","function":"fsub_internal"}},{"target":{"file":"ext/secp256k1_native/secp256k1_native.h"},"deprecated":false,"digest":{"line_hashes":["164814764488850751075706011421175202639","127485075147349990504718359998835752691","63863215534724358323702787324794168150","75870276970386442910562847504858049494","60506111110208801241002213018889377147","305511390888989933578670172603391110193"],"threshold":0.9},"id":"CVE-2026-63410-11cee3ce","signature_type":"Line","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e"},{"source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"file":"ext/secp256k1_native/scalar.c","function":"scalar_add_internal"},"deprecated":false,"digest":{"length":405,"function_hash":"236895978218041519827888792034327197867"},"id":"CVE-2026-63410-34d5a7df","signature_type":"Function","signature_version":"v1"},{"source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"file":"ext/secp256k1_native/secp256k1_native.h","function":"uint256_select"},"deprecated":false,"digest":{"function_hash":"324943066155152112223595956405033316649","length":465},"id":"CVE-2026-63410-465c5338","signature_type":"Function","signature_version":"v1"},{"signature_type":"Line","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"file":"ext/secp256k1_native/scalar.c"},"deprecated":false,"digest":{"line_hashes":["49836041089280141625505324204995770587","3536407383186833269081988086259486472","6684434200945625738153876727573792105","254774838179406676982965333050392037878","207962155451177183746560673463356815676","225644536481303724079939214932415654486","188609534955485464146735152875843721118","257241976695374417034510071609304979260"],"threshold":0.9},"id":"CVE-2026-63410-65e87434"},{"target":{"function":"fred_internal","file":"ext/secp256k1_native/field.c"},"deprecated":false,"digest":{"function_hash":"30844738807554010181383254066182106567","length":1235},"id":"CVE-2026-63410-6b1f6cd7","signature_type":"Function","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e"},{"deprecated":false,"digest":{"length":281,"function_hash":"303381010566014370176221644159047324957"},"id":"CVE-2026-63410-931c0980","signature_type":"Function","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"function":"fneg_internal","file":"ext/secp256k1_native/field.c"}},{"digest":{"threshold":0.9,"line_hashes":["192960113768259076558444176795158669235","76017685432389088995944182985523023443","17236163593979572716087469441904432826","39892298903907508410224894248688516526","250530069156551982365735323577994646600","178746738206757330304735487001907162556","235818794456462454564948542499916930075","13640047071259879232994675574274600155"]},"id":"CVE-2026-63410-9aa547c4","signature_type":"Line","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"file":"ext/secp256k1_native/jacobian.c"},"deprecated":false},{"deprecated":false,"digest":{"line_hashes":["178120520383435773598694362434714355972","53067950268258763361143784699409181369","303592524661936117208838046889366538145","320848368904144208640219422405364424336","315501183002126550037784532618708243730","264802659999872760196125052098621942688","188609534955485464146735152875843721118","257241976695374417034510071609304979260","236907089578124425672085225596954139842","42757896669303456749592134665994445081","165288034147590455448752865108285599038","259013364423208899584646601230211465550","316046374778671140484887397488985171846","2652688394787810411726964887294632396","246104796759060465701208485230776319165","62894000158389412922811758361128960304"],"threshold":0.9},"id":"CVE-2026-63410-ac7708f3","signature_type":"Line","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"file":"ext/secp256k1_native/field.c"}},{"target":{"file":"ext/secp256k1_native/jacobian.c","function":"cswap"},"deprecated":false,"digest":{"length":357,"function_hash":"325182496832702155154607183925445324497"},"id":"CVE-2026-63410-bb6e422f","signature_type":"Function","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e"},{"deprecated":false,"digest":{"function_hash":"30187962625071502483993594909162812563","length":1137},"id":"CVE-2026-63410-c6c3bc00","signature_type":"Function","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"file":"ext/secp256k1_native/jacobian.c","function":"jp_double_internal"}},{"source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"file":"ext/secp256k1_native/scalar.c","function":"scalar_reduce_limbs"},"deprecated":false,"digest":{"length":2158,"function_hash":"16595846334021149266499815608047645284"},"id":"CVE-2026-63410-d2d83c2e","signature_type":"Function","signature_version":"v1"},{"id":"CVE-2026-63410-dbf44688","signature_type":"Function","signature_version":"v1","source":"https://github.com/sgbett/secp256k1-native/commit/a89bea1617a2d063c6545ad44565dc22098c880e","target":{"function":"fadd_internal","file":"ext/secp256k1_native/field.c"},"deprecated":false,"digest":{"length":405,"function_hash":"337438102889025243530577857079449352653"}}],"vanir_signatures_modified":"2026-11-04T07:07:38Z"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"}]}