Repository navigation
openssl: bound EC point length in ssh2_ecdsa_create_key() - #2541
Closed
abdul-khaliq-khalid wants to merge 1 commit into
Closed
abdul-khaliq-khalid wants to merge 1 commit into
abdul-khaliq-khalid wants to merge 1 commit into
Conversation
ssh2_ecdsa_create_key()
There was a problem hiding this comment.
Pull request overview
Bounds the OpenSSL 3 EC public-point length before writing to a fixed-size stack buffer.
Changes:
- Rejects public points larger than
EC_MAX_POINT_LEN. - Aligns OpenSSL 3 behavior with the legacy path.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vszakats
approved these changes
Aug 27, 2026
Member
|
Thanks! |
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.
The OpenSSL 3 path of ssh2_ecdsa_create_key copies the generated public point into the fixed octal_value[EC_MAX_POINT_LEN] stack buffer, handing the length reported by EVP_PKEY_get_octet_string_param straight back as the destination capacity without checking it against the buffer. Every other point extraction in this file bounds the length against EC_MAX_POINT_LEN first, including the legacy path a few lines below in the same function. Add the same check right after the length is queried so both branches guard the stack write the same way.