[issue-3599] Harden SupportedAlgorithms variable block parser in GET_CAPABILITIES#3656
Open
czwolak wants to merge 1 commit into
Open
[issue-3599] Harden SupportedAlgorithms variable block parser in GET_CAPABILITIES#3656czwolak wants to merge 1 commit into
czwolak wants to merge 1 commit into
Conversation
…CAPABILITIES Gate parsing on the responder response bit (not only the requester request bit), add minimum-size guard before reading dynamic fields, validate block length against computed expected size from ext_asym_count/ext_hash_count/param1, and accept the case where requester requested SupportedAlgorithms but responder cleared the bit (optional responder support). Signed-off-by: Cezary Zwolak <cezary.zwolak@intel.com>
alistair23
approved these changes
Jun 22, 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.
Fixes #3599
Gate the SupportedAlgorithms variable block parsing on the responder response bit (not only the requester request bit), add a minimum-size guard before reading any dynamic fields, and validate the block's declared length against the computed expected length from
ext_asym_count,ext_hash_count, andparam1(number of struct tables).Changes:
CAPABILITIES.param1[SupportedAlgorithms]from the responder (was gated only on the requester request bit).response_size >= sizeof(CAPABILITIES) + sizeof(spdm_supported_algorithms_block_t)) before reading any dynamic fields.supported_algorithms->lengthis within[sizeof(block_t), remaining_response].length == fixed + ext_asym_count*4 + ext_hash_count*4 + param1*4.sizeof(spdm_capabilities_response_t)as effective size.Signed-off-by: Cezary Zwolak cezary.zwolak@intel.com