ml-dsa's UseHint function has off by two error when r0 equals zero
What to do
Vendor fix available. Upgrade each affected package to the fixed version on its release line (ml-dsa 0.1.0-rc.5), redeploy, then verify what is actually installed.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
crates.io ml-dsa
- Affected
- <= 0.1.0-rc.4
- Fixed in
- 0.1.0-rc.5
Sources
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-h37v-hp6w-2pp8 lists affected ranges: crates.io ml-dsa >=0 <=0.1.0-rc.4
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS 4.0
- 5.5 · CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P · score source
- EPSS
- No dated EPSS signal available.
Source description
As published by the source; long descriptions are shortened.
Summary There's a bug in the usehint function where it adds 1 instead of subtracting 1 when the decomposed low bits r0 equal exactly zero. FIPS 204 Algorithm 40 is pretty clear that r0 0 means strictly positive, but the current code treats zero as positive. This causes valid signatures to potentially fail verification when this edge case gets hit. Details The issue is in ml-dsa/src/hint.rs in the usehint function. Here's what FIPS 204 Algorithm 40 says: Line 3 uses r0 0 (strictly greater than zero), and line 4 uses r0 <= 0 (less than or equal, which includes zero). So when r0 = 0, the spec says to subtract 1. But the current implementation does this: The problem is r0.0 <= gamma2 includes zero. When r0 = 0, this condition is true (since 0 <= gamma2), so it adds 1. But according to the spec, r0 = 0 should fall into the r0 <= 0 case and subtract 1 instead. The result is +1 when it should be -1, which is an off by two error mod m. PoC Take MLDSA 44 where γ2 = 95,232 and m = 44. If…
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 1 · created ·
Published from ghsa record GHSA-h37v-hp6w-2pp8
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: GHSA-h37v-hp6w-2pp8 Advisory: ml-dsa's UseHint function has off by two error when r0 equals zero IDs: GHSA-h37v-hp6w-2pp8 Record: https://patchnext.com/advisories/ghsa-h37v-hp6w-2pp8 (revision 1, source checked 26 Oct 2026, 15:39 UTC) Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected. Severity: Medium (CVSS 5.5) Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV. Vendor response: Vendor fix available; fixed versions by package: ml-dsa 0.1.0-rc.5. A vendor fix does not mean a deployment is fixed. ## Affected components - crates.io ml-dsa: affected <= 0.1.0-rc.4; fixed in 0.1.0-rc.5 ## Suggested inspection (read-only) - crates.io ml-dsa: check the installed version with your package manager. ## Supported action Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version. ## Required regression checks - Run the test suite and a production build. - Exercise the features that depend on ml-dsa. - Repeat the inspection and confirm that only fixed versions remain installed. ## Rollback considerations - Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward. ## Unresolved questions - Which deployments run an affected version? - Exploitation status can change. Check again before lowering the priority. - Mark the work resolved only after the fixed version is verified in production. ## Sources - Verified: https://github.com/advisories/GHSA-h37v-hp6w-2pp8 (GitHub-reviewed advisory GHSA-h37v-hp6w-2pp8 lists affected ranges: crates.io ml-dsa >=0 <=0.1.0-rc.4) Commands are suggestions: review each one before running it.
Loading voting…