Email me

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.

Cratelibcrux-secrets
TypeVulnerability
Affected versionsBefore 0.0.6.
Fixed in0.0.6
Severitynot 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
Published2026-05-26
Last changed2026-07-17
Also known asnone
Affected functionslibcrux_secrets::Select::select, libcrux_secrets::Swap::swap

What to do

  1. See which version you have: cargo tree -i libcrux-secrets (it also shows which of your dependencies pulls it in).
  2. 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 example libcrux-secrets = "0.0.6") or update the dependency that pulls it in.
  3. 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

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 →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ