GHSA-25RM-9WVM-M38V
Vulnerability from github – Published: 2026-11-20 00:17 – Updated: 2026-11-20 00:17Reporter: 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<i64>withFRAC_UNIT = 1 << 32, i.e. 32 fractional bits (src/fixed_point.rs). The crate already definesFixedPoint128with 64 fractional bits, the correct-precision type, but the sampler usesFixedPoint64.approx_exp(samplerz.rs:34) evaluates the FACCT polynomial, whose coefficients are the correct 63-bit constants, but at line 59 it doeslet z: u64 = (x.0 as u64) << 31;. This takes the 32-bit-precision argument and zero-fills the low 31 bits into a 63-bit word, so the polynomial is evaluated at an argument quantized to 2^-32.sampler_zcomputesdss = 0.5 * isigma^2andccs = sigma_min * isigmain this 32-bit type, wheresigmais the per-leaf value derived from the secret basis Gram-Schmidt norms (ffSampling). The precision loss therefore lands on secret-dependent quantities.
Regression: commit bf2cf00 ("Eliminate f64 from key generation via generic FixedPoint") replaced the prior f64 sampler. git show bf2cf00^:src/samplerz.rs shows the old fn approx_exp(x: f64, ccs: f64) operating at 63-bit scale. The change landed before the 0.1.3 release. The maintainers then re-pinned their tests to the degraded output and loosened the tolerance, and the Falcon KAT vectors no longer pass.
Proof of concept (self-contained, reproducible)
Append the following module to falcon-rust/src/samplerz.rs and run:
cargo test -p falcon-rust --release dump_approx_exp_precision -- --nocapture
It calls the crate's own approx_exp and measures its maximum relative error against true exp() over the sampler's input domain [0, ln 2].
#[cfg(test)]
mod prec_test {
use super::*;
#[test]
fn dump_approx_exp_precision() {
let n: u64 = 500000;
let mut maxrel = 0.0f64;
let two63 = 9223372036854775808.0f64; // 2^63
for i in 0..=n {
let x = (i as f64 / n as f64) * std::f64::consts::LN_2;
let approx_u = approx_exp(FixedPoint64::from(x), FixedPoint64::ONE);
let approx = approx_u as f64 / two63; // ~ exp(-x)
let truev = (-x).exp();
let rel = ((approx - truev) / truev).abs();
if rel > maxrel { maxrel = rel; }
}
println!("MAXREL_APPROX_EXP={:.6e} log2={:.3}", maxrel, maxrel.log2());
let req = 2f64.powi(-40);
println!("FALCON_REQ_2^-40={:.3e} RATIO_OVER_REQ={:.1}x", req, maxrel / req);
let f64ref = 2f64.powi(-52);
println!("F64_SAMPLER_2^-52={:.3e} RATIO_OVER_F64={:.1}x", f64ref, maxrel / f64ref);
}
}
Measured output (rustc 1.96.1, x86-64, release):
MAXREL_APPROX_EXP=1.164152e-10 log2=-33.000
FALCON_REQ_2^-40=9.095e-13 RATIO_OVER_REQ=128.0x
F64_SAMPLER_2^-52=2.220e-16 RATIO_OVER_F64=524287.3x
So the sampler is at 2^-33, about 128x coarser than even the loosest cited requirement (2^-40), and about 500,000x coarser than the f64 sampler this code replaced.
Impact
The sampler's output distribution deviates from the specified discrete Gaussian by more than the security analysis allows, so the Renyi-divergence argument that guarantees the signature transcript hides the secret trapdoor no longer applies. Because the same sampler is used at key-generation time, the secret key itself is also drawn from a distribution that differs from the specified one. The deviation is secret-dependent, which is the property that statistical and hidden-number-problem learning attacks on biased Gaussian samplers exploit.
To be precise about scope (see Severity): this is a measured precision defect that voids the proof's precondition. It is not a demonstrated end-to-end key recovery.
Severity (honest scoping)
Medium. This is a measured failure to meet the scheme's mandated sampler precision, which for a cryptographic library is a defect in its own right, because the security proof's precondition is provably not met and the reference KAT vectors fail. It is not a demonstrated key-recovery attack. Being coarser than the required bound invalidates the proof, but does not by itself establish a practical break. Showing recovery would require a full statistical-learning simulation over many signatures, and whether that is feasible within a realistic signature budget at a per-sample bias of 2^-33 is an open question. That uncertainty is why this is scoped as an unsoundness and proof-conformance defect rather than a claimed exploit. Suggested RUSTSEC classification: informational = "unsound" (cryptographic-soundness defect), or a Medium advisory.
Fix
Perform sampler_z, ber_exp, and approx_exp at 53-bit precision (f64) or higher, or use the crate's existing FixedPoint128 (64 fractional bits) throughout the acceptance-probability computation. Restore the Falcon reference KAT vectors as the test oracle instead of the loosened tolerance.
Disclosure
Coordinated. Private notification to the maintainer first (this GitHub advisory), then RUSTSEC advisory-db. No public disclosure before maintainer contact.
Note on tooling
Claude Opus (Anthropic's coding assistant) was used to help test the hypothesis, specifically to build the crate and measure approx_exp against high-precision exp, and to help prepare this report. The measurements above are deterministic and independently reproducible with the included test.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.1.3"
},
"package": {
"ecosystem": "crates.io",
"name": "falcon-rust"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.2.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-77382"
],
"database_specific": {
"cwe_ids": [
"CWE-1240"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-20T00:17:04Z",
"nvd_published_at": "2026-11-19T17:19:00Z",
"severity": "MODERATE"
},
"details": "**Reporter:** Connor Webber\n**Package:** `falcon-rust` (crates.io), repository `github.com/aszepieniec/falcon-rust`\n**Affected:** v0.1.3 and the current `master` (HEAD `cfa1b35`). Regression introduced in commit `bf2cf00`.\n**Component:** discrete-Gaussian sampler, `src/samplerz.rs` (`approx_exp`, `ber_exp`, `sampler_z`)\n**Status:** Confirmed by source review and by empirical measurement of the crate\u0027s own compiled code.\n\n## Summary\n\nfalcon-rust\u0027s discrete-Gaussian rejection sampler evaluates its `exp()` acceptance step at only 32 bits of fractional precision. Measured directly against the crate\u0027s 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.\n\nFalcon\u0027s 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\u0027s 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.\n\nThere is a second, bound-independent piece of evidence that removes any ambiguity: the crate\u0027s sampler can no longer reproduce Falcon\u0027s 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.\n\nBecause the sampler\u0027s 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.\n\nThe crate\u0027s 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.\n\n## Technical detail\n\nRoot location: `src/samplerz.rs`\n\n* `FixedPoint64 = FixedPoint\u003ci64\u003e` with `FRAC_UNIT = 1 \u003c\u003c 32`, i.e. 32 fractional bits (`src/fixed_point.rs`). The crate already defines `FixedPoint128` with 64 fractional bits, the correct-precision type, but the sampler uses `FixedPoint64`.\n* `approx_exp` (`samplerz.rs:34`) evaluates the FACCT polynomial, whose coefficients are the correct 63-bit constants, but at line 59 it does `let z: u64 = (x.0 as u64) \u003c\u003c 31;`. This takes the 32-bit-precision argument and zero-fills the low 31 bits into a 63-bit word, so the polynomial is evaluated at an argument quantized to 2^-32.\n* `sampler_z` computes `dss = 0.5 * isigma^2` and `ccs = sigma_min * isigma` in this 32-bit type, where `sigma` is the per-leaf value derived from the secret basis Gram-Schmidt norms (ffSampling). The precision loss therefore lands on secret-dependent quantities.\n\nRegression: commit `bf2cf00` (\"Eliminate f64 from key generation via generic FixedPoint\u003cT\u003e\") replaced the prior f64 sampler. `git show bf2cf00^:src/samplerz.rs` shows the old `fn approx_exp(x: f64, ccs: f64)` operating at 63-bit scale. The change landed before the 0.1.3 release. The maintainers then re-pinned their tests to the degraded output and loosened the tolerance, and the Falcon KAT vectors no longer pass.\n\n## Proof of concept (self-contained, reproducible)\n\nAppend the following module to `falcon-rust/src/samplerz.rs` and run:\n\n`cargo test -p falcon-rust --release dump_approx_exp_precision -- --nocapture`\n\nIt calls the crate\u0027s own `approx_exp` and measures its maximum relative error against true `exp()` over the sampler\u0027s input domain `[0, ln 2]`.\n\n```rust\n#[cfg(test)]\nmod prec_test {\n use super::*;\n #[test]\n fn dump_approx_exp_precision() {\n let n: u64 = 500000;\n let mut maxrel = 0.0f64;\n let two63 = 9223372036854775808.0f64; // 2^63\n for i in 0..=n {\n let x = (i as f64 / n as f64) * std::f64::consts::LN_2;\n let approx_u = approx_exp(FixedPoint64::from(x), FixedPoint64::ONE);\n let approx = approx_u as f64 / two63; // ~ exp(-x)\n let truev = (-x).exp();\n let rel = ((approx - truev) / truev).abs();\n if rel \u003e maxrel { maxrel = rel; }\n }\n println!(\"MAXREL_APPROX_EXP={:.6e} log2={:.3}\", maxrel, maxrel.log2());\n let req = 2f64.powi(-40);\n println!(\"FALCON_REQ_2^-40={:.3e} RATIO_OVER_REQ={:.1}x\", req, maxrel / req);\n let f64ref = 2f64.powi(-52);\n println!(\"F64_SAMPLER_2^-52={:.3e} RATIO_OVER_F64={:.1}x\", f64ref, maxrel / f64ref);\n }\n}\n```\n\nMeasured output (rustc 1.96.1, x86-64, release):\n\n```\nMAXREL_APPROX_EXP=1.164152e-10 log2=-33.000\nFALCON_REQ_2^-40=9.095e-13 RATIO_OVER_REQ=128.0x\nF64_SAMPLER_2^-52=2.220e-16 RATIO_OVER_F64=524287.3x\n```\n\nSo the sampler is at 2^-33, about 128x coarser than even the loosest cited requirement (2^-40), and about 500,000x coarser than the f64 sampler this code replaced.\n\n## Impact\n\nThe sampler\u0027s output distribution deviates from the specified discrete Gaussian by more than the security analysis allows, so the Renyi-divergence argument that guarantees the signature transcript hides the secret trapdoor no longer applies. Because the same sampler is used at key-generation time, the secret key itself is also drawn from a distribution that differs from the specified one. The deviation is secret-dependent, which is the property that statistical and hidden-number-problem learning attacks on biased Gaussian samplers exploit.\n\nTo be precise about scope (see Severity): this is a measured precision defect that voids the proof\u0027s precondition. It is not a demonstrated end-to-end key recovery.\n\n## Severity (honest scoping)\n\nMedium. This is a measured failure to meet the scheme\u0027s mandated sampler precision, which for a cryptographic library is a defect in its own right, because the security proof\u0027s precondition is provably not met and the reference KAT vectors fail. It is not a demonstrated key-recovery attack. Being coarser than the required bound invalidates the proof, but does not by itself establish a practical break. Showing recovery would require a full statistical-learning simulation over many signatures, and whether that is feasible within a realistic signature budget at a per-sample bias of 2^-33 is an open question. That uncertainty is why this is scoped as an unsoundness and proof-conformance defect rather than a claimed exploit. Suggested RUSTSEC classification: `informational = \"unsound\"` (cryptographic-soundness defect), or a Medium advisory.\n\n## Fix\n\nPerform `sampler_z`, `ber_exp`, and `approx_exp` at 53-bit precision (f64) or higher, or use the crate\u0027s existing `FixedPoint128` (64 fractional bits) throughout the acceptance-probability computation. Restore the Falcon reference KAT vectors as the test oracle instead of the loosened tolerance.\n\n## Disclosure\n\nCoordinated. Private notification to the maintainer first (this GitHub advisory), then RUSTSEC advisory-db. No public disclosure before maintainer contact.\n\n## Note on tooling\n\nClaude Opus (Anthropic\u0027s coding assistant) was used to help test the hypothesis, specifically to build the crate and measure `approx_exp` against high-precision `exp`, and to help prepare this report. The measurements above are deterministic and independently reproducible with the included test.",
"id": "GHSA-25rm-9wvm-m38v",
"modified": "2026-11-20T00:17:04Z",
"published": "2026-11-20T00:17:04Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/aszepieniec/falcon-rust/security/advisories/GHSA-25rm-9wvm-m38v"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-77382"
},
{
"type": "WEB",
"url": "https://github.com/aszepieniec/falcon-rust/commit/930d766256f9d67ec9b6d437557286cf47f042ca"
},
{
"type": "WEB",
"url": "https://github.com/aszepieniec/falcon-rust/commit/bf2cf000e63a9803f7ab1a34f629a5a0e9c49cf6"
},
{
"type": "PACKAGE",
"url": "https://github.com/aszepieniec/falcon-rust"
},
{
"type": "WEB",
"url": "https://github.com/aszepieniec/falcon-rust/releases/tag/v0.2.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "falcon-rust: Discrete-Gaussian sampler runs at 2^-33 precision, far below Falcon\u0027s requirement (reference KAT vectors no longer pass)"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.