Repository navigation
Conversation
Reported-by: Vladimir Eli Tokarev Fixes GHSA-w6g9-cpfp-22gc
There was a problem hiding this comment.
Pull request overview
This PR addresses GHSA-w6g9-cpfp-22gc by adding a missing length check to prevent a potential out-of-bounds read while parsing comment_len in libssh2_publickey_list_fetch().
Changes:
- Add a bounds check ensuring the comment field fits within
listFetch_databefore using it.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+932
to
+936
| if(pkey->listFetch_s + comment_len > | ||
| pkey->listFetch_data + pkey->listFetch_data_len) { | ||
| ssh2_err(session, LIBSSH2_ERROR_BUFFER_TOO_SMALL, | ||
| "ListFetch data too short"); | ||
| goto err_exit; |
Member
Author
There was a problem hiding this comment.
I'd prefer capping the size to sane values. Also for other similar cases.
Member
Author
This was referenced Jul 26, 2026
Merged
shivammathur
added a commit
to winlibs/libssh2
that referenced
this pull request
Aug 2, 2026
Backport upstream libssh2 bounds checking for public-key comment lengths in src/publickey.c. CVE-2026-66034: heap out-of-bounds read via a crafted publickey-subsystem version 1 response, remotely triggerable by a malicious SSH server in libssh2 through 1.11.1. CWE: CWE-125, CWE-908 CVSS: 4.0/AV:N/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N (7.7 HIGH) Upstream-Commit: a13bb6c773f0d55ad1628cede57e99803cd898d9 Upstream-PR: libssh2/libssh2#2202
This was referenced Aug 3, 2026
This was referenced Aug 17, 2026
This was referenced Aug 31, 2026
This was referenced Sep 21, 2026
This was referenced Oct 12, 2026
This was referenced Oct 26, 2026
This was referenced Nov 2, 2026
This was referenced Nov 9, 2026
This was referenced Nov 23, 2026
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported-by: Vladimir Eli Tokarev
Fixes GHSA-w6g9-cpfp-22gc