RUSTSEC-2026-0385: Non-constant-time mask generation and `u128` comparisons
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Find where ctutils is referenced in Cargo.toml or Cargo.lock and bump it to >=0.4.4. Run cargo update and cargo test to verify the build. Check the advisory is resolved with cargo audit.
Written by the indexing model from the issue text.
Description
Non-constant-time mask generation and
u128comparisons
| 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.
- Dominant language
- Rust
- Stars
- 464
- Forks
- 37
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 7
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from esp-rs/espup
-
espup reports 0.18.0 is available, even though it's notPossibly taken @SergioGasquez claimed this 2 days ago. Openbug bug jury
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Toolchain installation fails with "GitHub API returned status code: 401 Unauthorized"Possibly taken @SergioGasquez claimed this 2 days ago. Openbug bug jury
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
enhancement feature request
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
area/tools bug session-analysis
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
nix-community/fenix#262 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
GabrieleLozupone/kokon#41 ·
Maintainers usually reply within 1 day
-
Small glitchOpenpriority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
storytold/photocraft#9538 ·
Maintainers usually reply within 1 day
-
bug P2 rust
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day