Skip to content

DMTF-2023-0002: Responder can Invoke Undefined Behavior in libspdm Requester

Moderate
jyao1 published GHSA-56h8-4gv5-jf2c Jun 1, 2023

Package

No package listed

Affected versions

2.3.2

Patched versions

2.3.3 and 3.0

Description

Impact

Following a successful CAPABILITIES response a libspdm Requester stores the Responder's CTExponent
into its context without validation. If the Requester sends a request message that requires
a cryptography operation by the Responder, such as CHALLENGE, libspdm will calculate the timeout value
using the Responder's unvalidated CTExponent.

((uint64_t)2 << context->connection_info.capability.ct_exponent)

If the value of CTExponent is greater than or equal to 64 then C language undefined behavior is invoked.
Note that libspdm provides a method to query the value of the CTExponent after VCA.

For X86 (ia32, x64) CPU, MSVC or GCC compiler generates SHL or SHLD instruction. SHL will cause
discarding, if bits shifted beyond the destination boundary. SHLD will will use 5 bits (32) or
6 bits (64) for the shifting. No security impact.

For ARM (arm, aarch64) CPU, GCC compiler generates LSL instruction, which will use 5 bits (32) or
6 bits (64) for the shifting. No security impact.

For RISC-V (32 or 64) CPU, GCC compiler generates SLL instruction, which will use 5 bits (32) or
6 bits (64) for the shifting. No security impact.

For other CPUs, the impact is unknown.

Patches

libspdm main:
libspdm 2.3:

Because libspdm 1.0, 2.0, 2.1, and 2.2 have known defects, they are not maintained.
libspdm 2.3 branch users should upgrade to release 2.3.3.

Workarounds

After completion of VCA the Requester can check the value of the Responder's CTExponent. If it greater than
or equal to 64 then the Requester can stop communication with the Responder. Note that the Requester would probably
want to do that anyways, since if CTExponent is greater than equal to 64 then the Responder is asserting that it may take many eons to complete a cryptography operation.

References

libspdm issue : #2068

Acknowledgement

This issue was discovered by the NVIDIA Offensive Security Research team.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Adjacent
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

CVE ID

CVE-2023-32690

Weaknesses