Skip to content

Integer Overflow in CreateHob() could lead to HOB OOB R/W

High
jkmathews published GHSA-ch4w-v7m3-g8wx Jan 9, 2024

Package

UefiPayloadPkg (EDK2)

Affected versions

<=202311

Patched versions

None

Description

Summary

An integer overflow can be triggered in CreateHob() when aligning the requested size.

This vulnerability was originally reported at https://bugzilla.tianocore.org/show_bug.cgi?id=4166.

Details

The CreateHob() function aligns the requested size to 8 performing the following operation:

HobLength = (UINT16)((HobLength + 0x7) & (~0x7));

No checks are performed to ensure this value doesn't overflow, and could lead to CreateHob() returning a smaller HOB than requested, which could lead to OOB HOB accesses.

Impact

Exploitability here seems tricky, as an attacker would need to trigger this vulnerability in the PEI phase. On the other hand, the number of calls to this function is fairly high.

Mitigation release plan

Patch files are available now via https://bugzilla.tianocore.org/show_bug.cgi?id=4166. Patch will be integrated for the Feb 2024 EDK2 release.

Severity

High
7.0
/ 10

CVSS base metrics

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

CVE ID

CVE-2022-36765

Weaknesses

Credits