der: ASN.1 REAL (f64) decoder panics on short binary-encoding value (index out of bounds)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- cryptography, security
调研方向
从 der/src/asn1/real.rs 中 f64 的 DecodeValue 实现开始,跟踪报告中描述的二进制编码分支。检查如何处理 0x80 这样仅有一个字节的值,然后运行相关的 DER REAL 解码器测试。若格式错误的短内容返回错误而不是触发 panic,即表示完成;报告没有指定具体的测试文件。
由索引模型根据 Issue 内容生成。
描述
Note: this was originally privately disclosed by @tonghuaroot as GHSA-27m6-7r55-vwr2. I am posting it publicly because it's in an off-by-default obscure feature that no one uses, and because we continue to receive duplicate LLM-generated reports about it.
The ASN.1 REAL decoder in the der crate (impl DecodeValue for f64, der/src/asn1/real.rs) validates only a minimum on the value content
length (header.length() == Length::ZERO) and then, for the binary-encoding branch, reads fixed byte offsets (bytes[1], and bytes[2] for the
two-octet exponent form) out of the attacker-controlled value content without confirming the content is long enough to hold the exponent field.A DER REAL value whose content is the single byte 0x80 reaches bytes[1] on a length-1 slice and triggers an index out of bounds panic
instead of returning Err. Any code that calls f64::from_der / f64::decode (or decodes a struct containing an f64) on untrusted bytes.
I will further add that accepting this feature at all was likely a mistake given the security/crypto-oriented nature of this library. It should probably be removed entirely in the next breaking release.
- 主要语言
- Rust
- 星标
- 343
- 派生
- 195
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 24
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RustCrypto/formats 的其他 Issue
-
pem-rfc7468: a lone CR before -----BEGIN is refused as Error::Preamble, so a CR-terminated multi-certificate PEM fails load_pem_chain (RFC 7468 eol = CRLF / CR / LF)可能已有人在做 @choksi2212 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
RustCrypto/formats#2486 · 1 条评论 ·
维护者通常 1 天内回复
-
IssuingDistributionPoint has the wrong AssociatedOid (id-pe-subjectInfoAccess)可能已有人在做 @eyusd 于 82 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 86/100
RustCrypto/formats#2389 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
RustCrypto/formats#2366 ·
维护者通常 1 天内回复
-
x509-cert 0.3.0 declares RFC 5914's TrustAnchorInfo v1 as 0, so it encodes v1 as INTEGER 0 and reads a written version 0 as v1可能已有人在做 @choksi2212 于 4 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 61/100
RustCrypto/formats#2487 · 2 条评论 ·
维护者通常 1 天内回复
-
x509-cert/const-oid: a 100-character OID (RFC 5280 Appendix B) needs 40 octets, so a certificate carrying one as a non-critical extension id does not decode可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
RustCrypto/formats#2485 · 3 条评论 ·
维护者通常 1 天内回复
查看 RustCrypto/formats 的全部 Issue
相似的 Issue
-
area/desktop-shell P1-high
难度 2/5 1-3 小时 新手友好度 76/100
yantrikos/yantrik-os#998 ·
维护者通常 1 天内回复
-
bug P2
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
plrigaux/sysd-manager#85 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
dsx-ai-factory/infra-controller#8341 ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复