Skip to content

[issue-3599] Harden SupportedAlgorithms variable block parser in GET_CAPABILITIES#3656

Open
czwolak wants to merge 1 commit into
DMTF:mainfrom
czwolak:issue-3599-supported-algs-parser-hardening
Open

[issue-3599] Harden SupportedAlgorithms variable block parser in GET_CAPABILITIES#3656
czwolak wants to merge 1 commit into
DMTF:mainfrom
czwolak:issue-3599-supported-algs-parser-hardening

Conversation

@czwolak

@czwolak czwolak commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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, and param1 (number of struct tables).

Changes:

  • Gate block parsing on CAPABILITIES.param1[SupportedAlgorithms] from the responder (was gated only on the requester request bit).
  • Add minimum-size check (response_size >= sizeof(CAPABILITIES) + sizeof(spdm_supported_algorithms_block_t)) before reading any dynamic fields.
  • Validate supported_algorithms->length is within [sizeof(block_t), remaining_response].
  • Validate length/count coherence: length == fixed + ext_asym_count*4 + ext_hash_count*4 + param1*4.
  • Explicit else-if for optional-responder-support case (requester bit set, responder bit cleared): accept and use base sizeof(spdm_capabilities_response_t) as effective size.

Signed-off-by: Cezary Zwolak cezary.zwolak@intel.com

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GET_CAPABILITIES/CAPABILITIES Insufficient Deep Consistency Validation for Supported-Algorithms Variable Block

2 participants