RUSTSEC-2026-0385: Non-constant-time mask generation and `u128` comparisons

Offen
#325 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
20/100
Issue-Typ
Bug
Klarheit
Muss geklärt werden
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
security

Rechercherichtung

The issue describes a security advisory for ctutils and links to RustCrypto/utils pull request 1569, but gives no numtracker files, tests, or requested change. Read the advisory and linked pull request first to determine whether numtracker uses an affected version and where it is declared; done means the project no longer uses a vulnerable version, if the dependency is present.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Non-constant-time mask generation and u128 comparisons

Details
Package ctutils
Version 0.4.2
URL https://github.com/RustCrypto/utils/pull/1569
Date 2026-10-23
Patched versions >=0.4.4

Summary

The ctutils::Choice type has mask generation functions for each unsigned
integer size (u8, u16, u32, u64, u128). These are const fn and
therefore can't reuse the asm!-backed mask generation in the cmov crate
that's otherwise used to ensure constant-time.

In releases prior to v0.4.4, the generated code from these functions could
include a branch on commonly used platforms. This has been corrected in this
release and now verified on several platforms using BINSEC.

Additionally, u128 comparison operations provided via ctutils::Choice and
intended to work in constant-time were generating branches on 32-bit targets.
This has been resolved via a special case implementation of these functions
for such targets.

Impact

Branch instructions on secret values can potentially leak such values via
covert channels. This can enable attackers to potentially recover such secrets.

Resolution

This has been resolved by calling Choice::to_u8() when generating the mask,
which in turn uses black_box as an optimization barrier. Verification that
this resulted in the desired change in the generated assembly across a variety
of target CPU architectures was performed by BINSEC, which now runs
automatically in CI using cargo checkct.

See advisory page for additional details.

Vorherrschende Sprache
Rust
Sterne
2
Forks
2
Ø Merge
13 Std. 13 Min.
Gemergte PRs (30 T.)
5

Entwicklungsumgebung

  • Enthält ein Dockerfile oder eine Docker-Compose-Datei
  • Keine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus DiamondLightSource/numtracker

Alle Issues in DiamondLightSource/numtracker

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.