Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

fix for cve-2026-55200 omitted checking one assignment

未關閉 適合新手
#2,676 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
74/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
c
領域
backend, security

研究方向

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):

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 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

libssh2/libssh2 的其他 Issue

查看 libssh2/libssh2 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。