Header bannerHeader banner
Advisory ID:
BRLY-2022-174

[BRLY-2022-174] Memory contents leak / information disclosure vulnerability in DXE driver on Dell platform.

September 21, 2023
Severity:
Medium
CVSS Score
6
Public Disclosure Date:
September 21, 2023
CVE ID:
CVE-2023-20597

Summary

BINARLY efiXplorer team has discovered a memory contents leak / information disclosure vulnerability that allows a potential attacker to dump stack memory or global memory into an NVRAM variable. This in turn could help building a successful attack vector based on exploiting a memory corruption vulnerability.

Vendors Affected

Affected Products

Inspiron 15 3525
,
Vostro 3525
,
Vostro 3425
,

Potential Impact

An attacker with high local access can exploit this vulnerability to read the contents of stack memory or global memory. This information could help with explotation of other vulnerabilities in DXE to elevate privileges from ring 3 or ring 0 (depends on the operating system) to a DXE driver and execute arbitrary code. Malicious code installed as a result of this exploitation could survive operating system (OS) boot process and runtime, or modify NVRAM area on the SPI flash storage (to gain persistence). Additionally, threat actors could use this vulnerability to bypass OS security mechanisms (modify privileged memory or runtime variables), influence OS boot process, and in some cases allow an attacker to hook or modify EFI Runtime services.

Summary

BINARLY efiXplorer team has discovered a memory contents leak / information disclosure vulnerability that allows a potential attacker to dump stack memory or global memory into an NVRAM variable. This in turn could help building a successful attack vector based on exploiting a memory corruption vulnerability.

Vulnerability Information

  • BINARLY internal vulnerability identifier: BRLY-2022-174
  • AMD PSIRT assigned CVE identifier: CVE-2023-20597
  • CVSS v3.1: 6.0 Medium AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N

Affected Dell firmware with confirmed impact by Binarly team

Product Firmware version CPU Module name Module GUID Module SHA256
Inspiron 15 3525,Vostro 3525,Vostro 3425 0.1.3.0 AMD AmdCcxZen3CznDxe 56aa1233-7407-4058-9e17-88de138ea15d fd8ddad069d3583eef335a4deed2906bf3b24fce19a7c8d51dc1606b326b5411

Potential impact

An attacker with high local access can exploit this vulnerability to read the contents of stack memory or global memory. This information could help with explotation of other vulnerabilities in DXE to elevate privileges from ring 3 or ring 0 (depends on the operating system) to a DXE driver and execute arbitrary code. Malicious code installed as a result of this exploitation could survive operating system (OS) boot process and runtime, or modify NVRAM area on the SPI flash storage (to gain persistence). Additionally, threat actors could use this vulnerability to bypass OS security mechanisms (modify privileged memory or runtime variables), influence OS boot process, and in some cases allow an attacker to hook or modify EFI Runtime services.

Vulnerability description

Let's take Inspiron 15 3525,Vostro 3525,Vostro 3425's firmware (version: 0.1.3.0, module sha256: fd8ddad069d3583eef335a4deed2906bf3b24fce19a7c8d51dc1606b326b5411) as an example.

The following code in the module actually allows leaking memory:

  • a call to a gRT->GetVariable() offset: 0x2827
  • a call to a gRT->SetVariable() offset: 0x285f
void sub_27C0()
{
  int v0; // eax
  __int64 v1; // rax
  int v2[4]; // [rsp+30h] [rbp-10h] BYREF
  char v3; // [rsp+50h] [rbp+10h] BYREF
  char v4; // [rsp+58h] [rbp+18h] BYREF
  __int64 v5; // [rsp+60h] [rbp+20h] BYREF

  sub_4C6C(1024i64, "  CcxCheckDownCoreStatus Entry\n");
  v2[0] = 41014;
  v0 = sub_5974(v2);
  v3 = 0;
  v5 = 1i64;
  v4 = v0 == 0;
  v1 = (gRT->GetVariable)(                      // <= first call (we can rewrite DataSize here)
         L"DownCoreStatus",
         &VendorGuid,
         0i64,
         &v5,
         &v3);
  if ( v4 != v3 || v1 )
  {
    (gRT->SetVariable)(                         // <= second call
      L"DownCoreStatus",
      &VendorGuid,
      7i64,
      v5,
      &v4);
    if ( v3 && !v4 )
    {
      sub_4C6C(1024i64, aDowncoredAutoI);
      (gRT->ResetSystem)(0i64, 0i64, 0i64, 0i64);
    }
  }
  sub_4C6C(1024i64, aCcxcheckdownco_0);
}

The gRT->SetVariable() service is called with the DataSize as an argument, which will be overwritten inside the gRT->GetVariable() service if the length of DownCoreStatus NVRAM variable is greater than 1.

Thus, a potential attacker can dump X - 1 bytes from the stack (or global memory) into DownCoreStatus NVRAM variable by setting DownCoreStatus NVRAM variable's size to X > 1.

To fix this vulnerability the DataSize must be re-initialized with the size of DownCoreStatus before calling gRT->SetVariable().

Disclosure timeline

This bug is subject to a 90 day disclosure deadline. After 90 days elapsed or a patch has been made broadly available (whichever is earlier), the bug report will become visible to the public.

Disclosure Activity Date (YYYY-mm-dd)
Dell PSIRT is notified 2022-12-29
AMD PSIRT assigned CVE number 2023-06-06
AMD PSIRT provide patch release 2023-09-20
BINARLY public disclosure date 2023-09-21

Acknowledgements

BINARLY efiXplorer team

Tags
No items found.
FWHunt
See if you are impacted now with our Firmware Vulnerability Scanner