-
-
Notifications
You must be signed in to change notification settings - Fork 328
build(ssh): patch libssh2 against CVE-2026-55200 #1877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+71
−4
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| CVE-2026-55200: out-of-bounds write in ssh2_transport_read() | ||
|
|
||
| libssh2 through 1.11.1 enforces no upper bound on the packet_length field when the cipher | ||
| requires a full packet (the encrypted + REQUIRES_FULL_PACKET branch). A malicious server can | ||
| send a crafted packet length, corrupt the heap before authentication completes, and reach | ||
| remote code execution. CVSS 4.0 base score 9.2. | ||
|
|
||
| The sibling branch already carries this bound check; only this path was missed. | ||
|
|
||
| Backported from upstream 97acf3dfda80c91c3a8c9f2372546301d4a1a7a8 ("transport.c: Additional | ||
| boundary checks for packet length", libssh2/libssh2#2052). The upstream commit does not apply | ||
| as-is: master renamed _libssh2_ntohu32() to ssh2_ntohu32() after 1.11.1 was cut. The guard | ||
| itself is unchanged. | ||
|
|
||
| 1.11.1 is the newest release and no release carries the fix yet. Delete this patch and bump | ||
| LIBSSH2_VERSION once one does. | ||
|
|
||
| https://nvd.nist.gov/vuln/detail/CVE-2026-55200 | ||
| https://github.com/libssh2/libssh2/pull/2052 | ||
|
|
||
| --- a/src/transport.c | ||
| +++ b/src/transport.c | ||
| @@ -639,8 +639,12 @@ | ||
| total_num = 4; | ||
|
|
||
| p->packet_length = _libssh2_ntohu32(block); | ||
| - if(p->packet_length < 1) | ||
| + if(p->packet_length < 1) { | ||
| return LIBSSH2_ERROR_DECRYPT; | ||
| + } | ||
| + else if(p->packet_length > LIBSSH2_PACKET_MAXPAYLOAD) { | ||
| + return LIBSSH2_ERROR_OUT_OF_BOUNDARY; | ||
| + } | ||
|
|
||
| /* total_num may include size field, however due to existing | ||
| * logic it needs to be removed after the entire packet is read |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When TableProMobile is built or tested, it links
../Libs/ios/LibSSH2.xcframeworkfrom the downloadedtablepro-libs-ios-v1.tar.gz, but this commit only updates the macOS.achecksums and adds patching to the future iOS rebuild script; it does not update or verify the shipped iOS xcframework. That leaves mobile SSH tunnels on the vulnerable libssh2 while the changelog says the CVE is patched, so please rebuild/upload the iOS archive before making this security claim or scope the note to macOS only.Useful? React with 👍 / 👎.