{"id":"RUSTSEC-2026-0625","summary":"Timing side channel in P-256 scalar validation leaks leading zero bytes of nonces and signing keys","details":"As part of P-256 scalar validation, `libcrux-ecdsa` prior to version\n`0.0.10` checked whether a scalar is zero by looping over its bytes\nwith a short-circuiting comparison. Since the loop stops at the first\nnon-zero byte, its running time reveals how many leading bytes of the\nscalar are zero.\n\n## Impact\nScalars are validated when ECDSA nonces and signing keys are generated\n(`Nonce::random`, `PrivateKey::random`, `rand::generate_key_pair` and\n`rand::sign`, which draw candidates with `rand::random_scalar`) and\nwhen private keys are imported (`PrivateKey::try_from`,\n`validate_scalar`). \n\nFor signing keys, the leak is limited to the number of leading zero\nbytes of the key, which alone does not enable key recovery. For\nnonces, each leaked leading zero byte reveals eight leading zero\nbits. Knowledge of the leading zero bits of ECDSA nonces is known to\nallow recovering the signing key with lattice attacks (see, e.g., the\nMinerva and TPM-Fail attacks). Since only about one in 256 nonces has\na leading zero byte, an attacker needs to time a large number of\nsigning operations under the same signing key.\n\nSignature verification and public-key operations are not affected.\n\n## Mitigation\n`libcrux-ecdsa` version `0.0.10` removes the short-circuiting\nzero-check. We recommend users upgrade to `libcrux-ecdsa` version\n`0.0.10`. Libcrux aims for secret-independence on the source code\nlevel but does not guarantee that compiled binaries are free of side\nchannels; mitigations are best effort.","modified":"2026-12-01T11:00:02.753193387Z","published":"2026-11-17T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/libcrux-ecdsa"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0625.html"},{"type":"WEB","url":"https://github.com/celabshq/libcrux/pull/1653"}],"affected":[{"package":{"name":"libcrux-ecdsa","ecosystem":"crates.io","purl":"pkg:cargo/libcrux-ecdsa"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.0.10"}]}],"ecosystem_specific":{"affects":{"arch":[],"os":[],"functions":["libcrux_ecdsa::p256::Nonce::random","libcrux_ecdsa::p256::PrivateKey::random","libcrux_ecdsa::p256::PrivateKey::try_from","libcrux_ecdsa::p256::rand::generate_key_pair","libcrux_ecdsa::p256::rand::random_scalar","libcrux_ecdsa::p256::rand::sign","libcrux_ecdsa::p256::validate_scalar"]},"affected_functions":null},"database_specific":{"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0625.json","categories":["crypto-failure"],"cvss":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","informational":null}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"}]}