Out-of-bounds read in portableproplib on a truncated XML plist preamble
还没有人认领这个 Issue。
评估
调研方向
The bug is in lib/portableproplib/prop_object.c at line 722, where a memcmp call reads out-of-bounds. Start by examining the MATCH macro and the surrounding parser logic in prop_object.c. Reproduce the issue with the minimal input '\x3c' and an ASan build. Check input length validation before fixed-length comparisons. The fix must be applied to the portableproplib code used by XBPS, and tests should be run to ensure repository index parsing (lib/repo.c) and archive handling (lib/archive.c) remain safe.
由索引模型根据 Issue 内容生成。
描述
I found a reproducible out-of-bounds read in XBPS's bundled portableproplib XML plist parser. In lib/portableproplib/prop_object.c, MATCH(str) calls memcmp(&xml[1], str, sizeof(str) - 1) before confirming that the input contains that many bytes. A one-byte input consisting only of < reaches this comparison.
Affected code tested: XBPS 0.60.7 and a frozen master revision at c5f41d5. With AddressSanitizer-enabled dictionary internalization builds, the one-byte input reports a five-byte heap-buffer-overflow read in _prop_object_internalize_context_alloc() at prop_object.c:722. I reproduced it again on both revisions on 23 September 2026; earlier testing also reached the same parser defect through the array internalization API. The test adapter allocates input_size + 1 bytes, copies the input, and appends a NUL terminator before invoking the upstream API. The invalid read therefore occurs despite the terminator.
Minimal input (hex): 3c (ASCII <). The relevant sanitizer trace begins:
ERROR: AddressSanitizer: heap-buffer-overflow
READ of size 5
#2 _prop_object_internalize_context_alloc .../lib/portableproplib/prop_object.c:722
#3 _prop_generic_internalize .../lib/portableproplib/prop_object.c:639
XBPS also passes repository index and metadata plist buffers to xbps_dictionary_internalize() in lib/repo.c, and archive dictionaries through lib/archive.c. This establishes product paths to the parser. I have not established a specific remote attacker model, native process termination, or information disclosure; the observed failure is the sanitizer-detected read while rejecting malformed input.
Please check the remaining input length before each fixed-length comparison and assess the affected release range. I can provide the full sanitizer log and adapter source if helpful.
I submitted a CVE ID request to MITRE CNA-LR under tracking number CAN-2026-2052927. This is a request tracking number, not an assigned CVE ID. Please coordinate on this existing request rather than filing a duplicate for the same root cause. For public credit, please identify He Huang as the finder and NexusSan as the discovery tool.
- 主要语言
- C
- 星标
- 1.1k
- 派生
- 151
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
void-linux/xbps 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
void-linux/xbps#475 ·
-
难度 4/5 3-5 天 新手友好度 55/100
void-linux/xbps#700 ·
-
bug
难度 3/5 1-2 天 新手友好度 45/100
void-linux/xbps#696 ·
-
难度 3/5 1-2 天 新手友好度 52/100
void-linux/xbps#695 · 7 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
void-linux/xbps#694 · 3 条评论 ·
相似的 Issue
-
难度 2/5 1-2 天 新手友好度 78/100
brunodev85/gladio#18 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
OpenPrinting/cups#1721 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
zephyrproject-rtos/zephyr#120318 · 1 条评论 ·
-
issue: bug report
难度 1/5 1 小时以内 新手友好度 90/100
-
[BUG] [25.12.5] 未关闭
难度 2/5 1-3 小时 新手友好度 72/100