RustSec logo

History ⋅ Edit ⋅ JSON (OSV)

RUSTSEC-2026-0625

Timing side channel in P-256 scalar validation leaks leading zero bytes of nonces and signing keys

Reported
Issued
Package
libcrux-ecdsa (crates.io)
Type
Vulnerability
Categories
Keywords
#ecdsa #p256 #timing #side-channel #nonce
References
CVSS Score
8.2 HIGH
CVSS Details
Attack Complexity
High
Attack Requirements
None
Attack Vector
Network
Privileges Required
None
Availability Impact to the Subsequent System
None
Confidentiality Impact to the Subsequent System
None
Integrity Impact to the Subsequent System
None
User Interaction
None
Availability Impact to the Vulnerable System
None
Confidentiality Impact to the Vulnerable System
None
Integrity Impact to the Vulnerable System
High
CVSS Vector
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
Patched
  • >=0.0.10
Affected Functions
Version
libcrux_ecdsa::p256::Nonce::random
  • <0.0.10
libcrux_ecdsa::p256::PrivateKey::random
  • <0.0.10
libcrux_ecdsa::p256::PrivateKey::try_from
  • <0.0.10
libcrux_ecdsa::p256::rand::generate_key_pair
  • <0.0.10
libcrux_ecdsa::p256::rand::random_scalar
  • <0.0.10
libcrux_ecdsa::p256::rand::sign
  • <0.0.10
libcrux_ecdsa::p256::validate_scalar
  • <0.0.10

Description

As part of P-256 scalar validation, libcrux-ecdsa prior to version 0.0.10 checked whether a scalar is zero by looping over its bytes with a short-circuiting comparison. Since the loop stops at the first non-zero byte, its running time reveals how many leading bytes of the scalar are zero.

Impact

Scalars are validated when ECDSA nonces and signing keys are generated (Nonce::random, PrivateKey::random, rand::generate_key_pair and rand::sign, which draw candidates with rand::random_scalar) and when private keys are imported (PrivateKey::try_from, validate_scalar).

For signing keys, the leak is limited to the number of leading zero bytes of the key, which alone does not enable key recovery. For nonces, each leaked leading zero byte reveals eight leading zero bits. Knowledge of the leading zero bits of ECDSA nonces is known to allow recovering the signing key with lattice attacks (see, e.g., the Minerva and TPM-Fail attacks). Since only about one in 256 nonces has a leading zero byte, an attacker needs to time a large number of signing operations under the same signing key.

Signature verification and public-key operations are not affected.

Mitigation

libcrux-ecdsa version 0.0.10 removes the short-circuiting zero-check. We recommend users upgrade to libcrux-ecdsa version 0.0.10. Libcrux aims for secret-independence on the source code level but does not guarantee that compiled binaries are free of side channels; mitigations are best effort.

Advisory available under CC0-1.0 license.