# RustCrypto cmov 非常量时间汇编漏洞
## 概述
RustCrypto CMOV 库中 `cmovnz` 的可移植实现,在特定平台下未生成常数时间汇编代码,存在时序侧信道风险。
## 影响版本
0.4.4 之前版本
## 细节
在 `thumbv6m-none-eabi` 平台(Cortex-M0、M0+、M1)上,`cmovnz` 的可移植版本在编译时被展开为非常数时间的汇编指令序列,破坏了条件移动操作的常数时间保证,可能导致敏感数据通过时序分析泄露。
## 影响
攻击者可能利用时序差异推测执行路径,进而获取加密操作中的敏感信息(如密钥),破坏密码操作的安全性。
是否为 Web 类漏洞: 未知
判断理由:
| # | POC 描述 | 源链接 | 神龙链接 |
|---|
标题: cmov: `thumbv6m-none-eabi` compiler emits non-constant time assembly when using `cmovnz` · Advisory · RustCrypto/utils · GitHub -- 🔗来源链接
标签:x_refsource_CONFIRM
神龙速读:
### 关键信息
- **漏洞描述**
- **标题**: `cmov: `thumbv6m-none-eabi` compiler emits non-constant time assembly when using `cmovnz``
- **问题**: 编译器在使用 `cmovnz` 时生成了非恒定时间的汇编代码,影响到了 Cortex M0、M0+ 和 M1 的 ARM 处理器。
- **版本影响**: `<0.4.4`
- **已修复版本**: `0.4.4`
- **报告者**: NicsTr
- **严重性**
- **CVSS v4评分**: 8.9 / 10
- **风险等级**: High
- **CVE ID**: CVE-2026-23519
- **弱点类型**: CWE-208
- **影响**
- 精确影响尚不明确,但可能破坏 `cmov` 提供的恒定时间保证。
- **补丁和修复**
- *升级至版本 0.4.4 可以避免此漏洞*
- **其他信息**
- 代码示例与汇编输出显示了问题的具体表现形式。
标题: cmov: fix portable `cmovnz` for `thumbv6m-none-eabi` (#1332) · RustCrypto/utils@5597725 · GitHub -- 🔗来源链接
标签:x_refsource_MISC
神龙速读:
- **Project & Commit Information:**
- Project: RustCrypto/utils (Public)
- Commit Hash: 5597725
- Commit Author: NicsTr, 5 days ago
- Merged into: master
- Version: v0.1.0-pre.0
- **Commit Summary:**
- **Title:** cmov: fix portable cmovnz for thumbv6m-none-eabi
- **Issue Addressed:** #1332
- **Description:**
- For the `thumbv6m-none-eabi` architecture (Cortex M0, M0+ and M1), the compiler emits non-constant time assembly when using `cmovnz` (portable version).
- This commit fixes the issue by modifying the `cmovnz` implementation.
- **Files Changed (2 files, 9 lines added, 5 lines removed):**
- updated `.typos.toml`:
` extend-exclude = [
".git/",
[default.extend-words] ];
"CMO" = "CMO"`
- edited `cmov/src/portable.rs`:
- Introduced `black_box` utility function to prevent compiler optimizations that introduced non-constant-time behavior in `cmovnz`.
- Removed unnecessary `black_box` calls in `CmovEq` implementations for u32 and u64.
- Removed unnecessary `black_box` calls in `cmov` and `cmoveq` implementations.
暂无评论