Skip to content

Commit d14cf60

Browse files
tarcieridjc
authored andcommitted
ml-dsa: add "Timing side-channel in ML-DSA decomposition"
Previously published as: CVE-2026-22705, GHSA-hcp2-x6j4-29j7
1 parent 6cd9c30 commit d14cf60

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

crates/ml-dsa/RUSTSEC-0000-0000.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
```toml
2+
[advisory]
3+
id = "RUSTSEC-0000-0000"
4+
package = "ml-dsa"
5+
date = "2025-12-12"
6+
url = "https://github.com/RustCrypto/signatures/security/advisories/GHSA-hcp2-x6j4-29j7"
7+
categories = ["crypto-failure"]
8+
cvss = "CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
9+
aliases = ["CVE-2026-22705","GHSA-hcp2-x6j4-29j7"]
10+
license = "CC-BY-4.0"
11+
12+
[versions]
13+
patched = [">= 0.1.0-rc.3"]
14+
```
15+
16+
# Timing side-channel in ML-DSA decomposition
17+
18+
### Summary
19+
20+
A timing side-channel was discovered in the Decompose algorithm which is used during ML-DSA signing to generate hints for the signature.
21+
22+
### Details
23+
24+
The analysis was performed using a constant-time analyzer that examines compiled assembly code for instructions with data-dependent timing behavior. The analyzer flags:
25+
26+
- **UDIV/SDIV instructions**: Hardware division instructions have early termination optimizations where execution time depends on operand values.
27+
28+
The `decompose` function used a hardware division instruction to compute `r1.0 / TwoGamma2::U32`. This function is called during signing through `high_bits()` and `low_bits()`, which process values derived from secret key components:
29+
30+
- `(&w - &cs2).low_bits()` where `cs2` is derived from secret key component `s2`
31+
- `Hint::new()` calls `high_bits()` on values derived from secret key component `t0`
32+
33+
**Original Code**:
34+
```rust
35+
fn decompose<TwoGamma2: Unsigned>(self) -> (Elem, Elem) {
36+
// ...
37+
let mut r1 = r_plus - r0;
38+
r1.0 /= TwoGamma2::U32; // Variable-time division on secret-derived data
39+
(r1, r0)
40+
}
41+
```
42+
43+
### Impact
44+
45+
The dividend (`r1.0`) is derived from secret key material. An attacker with precise timing measurements could extract information about the signing key by observing timing variations in the division operation.
46+
47+
### Mitigation
48+
49+
Integer division was replaced with a constant-time Barrett reduction.

0 commit comments

Comments
 (0)