Rust advisories / libcrux-secrets
VulnerabilityRUSTSEC-2026-0212 · libcrux-secrets
RUSTSEC-2026-0212: Potentially Incorrect Output of Constant-Time Swap/Select on Aarch64
Short answerA security vulnerability in the libcrux-secrets crate: Potentially Incorrect Output of Constant-Time Swap/Select on Aarch64. No severity score was published. Fixed in 0.0.6: update to a fixed version.
| Crate | libcrux-secrets |
|---|---|
| Type | Vulnerability |
| Affected versions | Before 0.0.6. |
| Fixed in | 0.0.6 |
| Severity | not scored CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| Published | 2026-05-26 |
| Last changed | 2026-07-17 |
| Also known as | none |
| Affected functions | libcrux_secrets::Select::select, libcrux_secrets::Swap::swap |
What to do
- See which version you have:
cargo tree -i libcrux-secrets(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p libcrux-secrets. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplelibcrux-secrets = "0.0.6") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
The implementation of constant-time swap and select on aarch64 platforms used a cmp instruction in inline assembly to check whether an 8-bit wide selector was 0. The cmp instruction works on 32-bit registers, which included the unspecified high 24 bits of the cmp operand. Depending on the execution environment the cmp could thus potentially return an incorrect result because its operand's high bits in the inline assembly were set when Rust expected them to be unset. This could lead to incorrect results for the constant-time swap and select operations built from this comparison.
Impact
In certain circumstances the swap and select instructions on aarch64 platforms returned incorrect results.
Mitigation
Starting from version 0.0.6, the selector is compared using a tst instruction with a mask, which only compares the first 8 bits of the selector.
References
- Package: crates.io/crates/libcrux-secrets
- Advisory: rustsec.org/advisories/RUSTSEC-2026-0212.html
- Web: github.com/celabshq/libcrux/pull/1461
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?