Skip to content

Buffer Overlow in TSS2_RC_Decode

Low
williamcroberts published GHSA-4j3v-fh23-vx67 Jan 19, 2023

Package

tpm2-tss (Linux Distros)

Affected versions

<= 4.0.0

Patched versions

TBD

Description

Report

Reported by fergus-dall: https://github.com/fergus-dall

Tss2_RC_SetHandler and Tss2_RC_Decode both index into layer_handler with an 8 bit layer number, but the array only has TPM2_ERROR_TSS2_RC_LAYER_COUNT entries, so trying to add a handler for higher-numbered layers or decode a response code with such a layer number reads/writes past the end of the buffer. For example, on my system this program segfaults:

#include <stdio.h>
#include "tss2/tss2_rc.h"

int main() {
    printf("%s\n", Tss2_RC_Decode(0xffffffff));
}

Impact

Buffer overrun, could result in arbitrary code execution. An example attack would be a MiTM bus attack that returns 0xFFFFFFFF for the RC.

Patches

in progress.

Workarounds

No

References

No

Severity

Low
0.0
/ 10

CVSS base metrics

Attack vector
Local
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
None
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:N

CVE ID

CVE-2023-22745

Weaknesses

No CWEs