fix for cve-2026-55200 omitted checking one assignment
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
issue指出了src/transport.c中對packet_length的指定,並提供了遺漏檢查的路徑。搭配提交97acf3dfda80c91c3a8c9f2372546301d4a1a7a8閱讀這段程式碼,比較各個驗證路徑,接著執行相關的transport測試。當所述路徑上的每處指定都拒絕小於1或大於LIBSSH2_PACKET_MAXPAYLOAD的值,且測試通過時,即告完成。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
The cve-2026-55200 underpinnings were pathways in which math on a very large packet_length would wrap around, resulting in an undersized allocation and later examinations based on that original packet_length.
The solution was, in commit https://github.com/libssh2/libssh2/commit/97acf3dfda80c91c3a8c9f2372546301d4a1a7a8 to check if the packet_length was <1 or > LIBSSH2_PACKET_MAXPAYLOAD , and fail either case.
However, one packet_length assignment was missed, and thus a path by which packet_length math can lead to a total_num wraparound bug.
To Reproduce
I have no reproduction other than examination of the code: paraphrased from src/transport.c it is thus:
... (many lines omitted to clarify packet_length assignment and checks) ...
if(etm) {}
else if(encrypted && session->remote.crypt->get_len) {}
else {
p->packet_length = ssh2_ntohu32(block);
}
if(!encrypted || !CRYPT_FLAG_R(session, SSH2_CRYPT_FLAG_REQUIRES_FULL_PACKET)) {
if(p->packet_length < 1)
return LIBSSH2_ERROR_DECRYPT;
else if(p->packet_length > LIBSSH2_PACKET_MAXPAYLOAD)
return LIBSSH2_ERROR_OUT_OF_BOUNDARY;
if(etm) {
p->packet_length = ssh2_ntohu32(block); **<<<<====== WHY ISN'T THIS ONE CHECKED?**
}
}
else {
p->packet_length = ssh2_ntohu32(block);
if(p->packet_length < 1)
return LIBSSH2_ERROR_DECRYPT;
else if(p->packet_length > LIBSSH2_PACKET_MAXPAYLOAD)
return LIBSSH2_ERROR_OUT_OF_BOUNDARY;
}
Version (please complete the following information):
- libssh2 version: https://github.com/libssh2/libssh2/commit/3209951db4e47ef902db047d12f9f464f835c27e head as of time of reporting
Additional context
(https://web.archive.org/web/20260623211210/https://github.com/bikini/exploitarium/tree/main/libssh2-cve-2026-55200-poc) excellent walkthrough of what the problem is
- 主要語言
- C
- 星號
- 1.6k
- 分支
- 646
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
libssh2/libssh2 的其他 Issue
-
AEAD ciphers (chacha20-poly1305, AES-GCM) leak 16 bytes of uninitialized memory per outgoing encrypted packet可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉memory-leak
難度 2/5 1-3 小時 新手友好度 85/100
libssh2/libssh2#2023 · 5 則留言 ·
維護者通常 1 天內回覆
-
documentation
難度 4/5 3-5 天 新手友好度 48/100
libssh2/libssh2#2597 · 2 則留言 ·
維護者通常 1 天內回覆
-
Q&A
難度 4/5 3-5 天 新手友好度 45/100
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 35/100
libssh2/libssh2#1925 · 13 則留言 · 32 個 reaction ·
維護者通常 1 天內回覆
-
To avoid interfering with auth, send keepalives at the end of the interval instead of the beginning可能已有人在做 @MatrixManAtYrService 於 236 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 35/100
libssh2/libssh2#1810 · 1 則留言 ·
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
-
難度 1/5 1 小時以內 新手友好度 93/100
webarkit/WebARKitLib#107 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
polhenarejos/pico-fido#302 ·
-
難度 2/5 1-3 小時 新手友好度 67/100
espressif/esp-vision#16 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 74/100
libsdl-org/SDL#16577 ·
維護者通常 1 天內回覆