Add negative-count and NULL checks to group-setting and shared-cipher APIs#10249
Draft
ColtonWilley wants to merge 1 commit intowolfSSL:masterfrom
Draft
Add negative-count and NULL checks to group-setting and shared-cipher APIs#10249ColtonWilley wants to merge 1 commit intowolfSSL:masterfrom
ColtonWilley wants to merge 1 commit intowolfSSL:masterfrom
Conversation
…d cipher APIs Add count < 0 validation to wolfSSL_CTX_set_groups and wolfSSL_set_groups (src/tls.c) to prevent negative count from bypassing the upper-bound check and corrupting numGroups via byte truncation. Widen count == 0 to count <= 0 and add NULL groups check in wolfSSL_CTX_set1_groups and wolfSSL_set1_groups (src/ssl.c). Add NULL buf and NULL cipher checks in wolfSSL_get_shared_ciphers to prevent NULL pointer dereference.
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.
wolfSSL_CTX_set_groups/wolfSSL_set_groups: addcount < 0toentry guard — negative count passes the upper-bound check and truncates
to a garbage
numGroupsbyte, causing OOB read during SSL initwolfSSL_CTX_set1_groups/wolfSSL_set1_groups: widencount == 0to
count <= 0and add NULLgroupscheckwolfSSL_get_shared_ciphers: add NULL checks forbufandwolfSSL_get_cipher_name_ianareturn value