secp256k1-native's constant-time claim did not survive the compiler
secp256k1-native's constant-time claim did not survive the compiler Constant-time code is a property of the machine instructions that actually run, not only of the source. secp256k1-native's Point#mul used a branchless
secp256k1-native's constant-time claim did not survive the compiler
Constant-time code is a property of the machine instructions that actually run, not only of the source. secp256k1-native's Point#mul used a branchless selection idiom intended to avoid secret-dependent control flow. With GCC 14 or 15 at -O2, the compiler reconstructed a conditional jump from that idiom.
The issue is CVE-2026-63410. Versions before 0.18.0 are affected, and 0.18.0 contains the fix. GitHub rates the advisory Moderate with a CVSS score of 5.9.
The affected operation is the default scalar multiplication path used for private keys and nonces. A timing signal that depends on the secret scalar can help an attacker recover key material or reduce the search space for a signature nonce. The advisory does not establish that a remote request alone is enough; the attacker needs a way to observe timing and repeatedly trigger the operation. Shared hosts, exposed signing services and environments with stable network paths matter.
Why branchless source is not enough
Compilers optimize abstract source into new control flow. A select operation, arithmetic mask or helper function can be lowered into a conditional branch if the compiler decides that is faster for the target architecture. Optimization level, compiler version, flags and CPU features all affect the result.
That is why constant-time implementations need instruction-level inspection and statistical tests across target builds. A source review can show intent, but it cannot prove that every distributed binary preserves the intent.
Upgrade to 0.18.0 or later. If a compiled gem is used, rebuild it against the patched source and the compiler configuration you actually deploy. Check whether the application loads a platform gem from a cache that predates the fix. A lock file alone does not prove which native binary is executing.
Review high-value signing paths
Prioritize installations where the library protects long-lived signing keys, wallet operations, authentication tokens or nonce generation in a multi-tenant service. Pin the compiler and build image for security-sensitive releases. Retain reproducible build metadata and disassemble Point#mul to confirm the secret-selection path does not contain a branch that depends on scalar bits.
Timing tests should run in an isolated environment with realistic CPU affinity, load and compiler output. A clean unit test on a developer laptop is weak evidence for production. Keep the test methodology and compiler identity with the release record so a future rebuild is not accepted solely because the version string looks correct.
If the deployment cannot establish whether the vulnerable binary was used, rotate affected keys or move high-value signing to a patched component. That decision depends on exposure and key lifetime; a library upgrade alone does not undo past leakage.
Operational lesson
Native cryptographic packages sit at the intersection of software supply chain and side-channel risk. Locking a source version is useful, but the compiler is part of the trust boundary. Treat changes to compiler version, optimization flags and target architecture as security-relevant changes that require new verification.
References
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.