GHSA-25rm-9wvm-m38v: falcon-rust: Discrete-Gaussian sampler runs at 2^-33 precision, far below Falcon's requirement (reference KAT vectors no longer pass)
- Source:
- OSV.dev
- Published:
- Fetched:
- Updated:
- Affects:
- falcon-rust
https://osv.dev/vulnerability/GHSA-25rm-9wvm-m38v ↗
falcon-rust: Discrete-Gaussian sampler runs at 2^-33 precision, far below Falcon's requirement (reference KAT vectors no longer pass) **Reporter:** Connor Webber **Package:** `falcon-rust` (crates.io), repository `github.com/aszepieniec/falcon-rust` **Affected:** v0.1.3 and the current `master` (HEAD `cfa1b35`). Regression introduced in commit `bf2cf00`. **Component:** discrete-Gaussian sampler, `src/samplerz.rs` (`approx_exp`, `ber_exp`, `sampler_z`) **Status:** Confirmed by source review and by empirical measurement of the crate's own compiled code. ## Summary falcon-rust's discrete-Gaussian rejection sampler evaluates its `exp()` acceptance step at only 32 bits of fractional precision. Measured directly against the crate's own compiled code, `approx_exp` has a maximum relative error of 2^-33. For comparison, the Falcon reference implementation achieves about 2^-63, and the f64 code this crate replaced achieved about 2^-52. The current sampler is therefore roughly 2^19 (about 500,000x) less precise than the version it replaced, and about 2^30 less precise than the reference. Falcon's security proof relies on the sampled signatures being statistically indistinguishable from an ideal discrete Gaussian, so the signature transcript leaks nothing about the secret trapdoor. That guarantee holds only when the sampler's relative error stays small enough, over the roughly 2^64 signature budget, to keep the Renyi divergence between the real and ideal distributions negligible. The precision the security analysis relies on is cited in the literature between roughly 2^-40 and 2^-46 (for example the FACCT and isochronous-sampling analyses). At 2^-33 the sampler is below every value in that range, roughly 128x to 4096x too coarse depending on which bound you take, so the precondition the proof depends on is not met. There is a second, bound-independent piece of evidence that removes any ambiguity: the crate's sampler can no longer reproduce Falcon's known-answer test (KAT) vectors, which are the authoritative correctness oracle. Rather than restore the precision, the maintainers loosened their own test tolerance and noted that "rejection decisions may differ at the boundary." The regression is already visible in-tree; its security significance was simply not recognized. Because the sampler's sigma is derived from the secret basis Gram-Schmidt norms, the resulting distribution deviation is secret-dependent. The `exp` function itself is public, but its inputs, and therefore the deviation, depend on secret quantities. This is the class of flaw that statistical and hidden-number-problem learning attacks on biased Gaussian samplers target. The crate's own documentation describes this sampler as "side-channel-hardened" and notes that "the sampler defines the secret-key distribution, so getting it wrong weakens the cryptography," which is exactly the property this defect touches. ## Technical detail Root location: `src/samplerz.rs` * `FixedPoint64 = FixedPoint ` with `FRAC_UNIT = 1 << 32`, i.e. 32 fractional bits (`src/fixed_point.rs`). The crate already defines `FixedPoint128` with 6 Affected: crates.io:falcon-rust Fixed in: 0.2.0 References: https://github.com/aszepieniec/falcon-rust/security/advisories/GHSA-25rm-9wvm-m38v https://nvd.nist.gov/vuln/detail/CVE-2026-77382 https://github.com/aszepieniec/falcon-rust/commit/930d766256f9d67ec9b6d437557286cf47f042ca https://github.com/aszepieniec/falcon-rust/commit/bf2cf000e63a9803f7ab1a34f629a5a0e9c49cf6 https://github.com/aszepieniec/falcon-rust https://github.com/aszepieniec/falcon-rust/releases/tag/v0.2.0