Vulnerabilities May Allow Attackers To Gain Admin Privileges
By Prajeet Nair (@prajeetspeaks) • April 20, 2022
Researchers at security firm ESET have found three vulnerabilities affecting Lenovo laptop models that, while geared to consumers, are widely used internationally, making them a risk for employees working from home.
Two of the vulnerabilities, tracked as CVE-2021-3971 and CVE-2021-3972, affect the laptops’ Unified Extensible Firmware Interface, or UEFI, firmware drivers, originally meant to be used only during the manufacturing process of Lenovo notebooks, the researchers say.
The third vulnerability, tracked as CVE-2021-3970, is a System Management Mode, or SMM, memory corruption bug that can lead to the execution of malicious code with SMM privileges and deployment of an SPI flash implant, which is memory storage in the motherboard capable of persisting in the system across disk formatting or replacement, the researchers say.
CVSS scores have not yet been assigned for any of the bugs.
“This issue exposes the affected systems at a very basic level and can potentially help malicious actors bypass any security controls that the owners of these laptops may have installed,” says chief information security officer at cybersecurity firm SafeBreach in Atlanta, Avishai Avivi,. “The root of this vulnerability is a bit different from other supply chain vulnerabilities. The manufacturer, Lenovo, created a piece of backdoor code that intentionally disabled security mechanisms.”
UEFI Flaw
Unified Extensible Firmware Interface helps initiate the booting sequence within a PC and loads the device’s operating system.
Exploiting this essential feature, the researchers say, can allow attackers to deploy and execute SPI flash or ESP implants, such as LoJax or the newly discovered UEFI malware ESPecter, on the affected devices.
ESET uncovered the LoJax rootkit in 2018. It was used to target government organizations in central and Eastern Europe and was believed to have been developed by sophisticated Russian hackers.
“UEFI threats can be extremely stealthy and dangerous. They are executed early in the boot process, before transferring control to the operating system, which means that they can bypass almost all security measures and mitigations higher in the stack that could prevent their OS payloads from being executed,” says malware analyst at ESET, Martin Smolár.
The researchers say that the list of affected devices contains more than 100 different laptop models, with millions of users. These models include IdeaPad 3 as well as more advanced models, such as the Legion 5 Pro 16ACH6H and the Yoga Slim 9-14ITL05.
Technical Details
The researchers say they reported all the discovered vulnerabilities to Lenovo on Oct. 11, 2021. Lenovo assigned the CVEs on Nov. 17, 2021.
CVE-2021-3970
LenovoVariableSmm allows SMM arbitrary read/write from/into SMRAM. SMM is described by the researchers as a highly privileged execution mode of x86 processors. Often referred to as ring -2, it is written within the context of the system firmware and is used for various tasks, including advanced power management, execution of OEM proprietary code and secure firmware updates.
SMM code provides an execution environment invisible to the running operating system. The code and data used in SMM are stored in hardware-protected memory, accessible only from SMM, called SMRAM.
But to enter SMM, an interrupt processor needs to be triggered. This processor is System Management Interrupt, or SMI, which can be triggered via software or the platform hardware.
A security advisory from Lenovo describes CVE-2021-3970 as a potential vulnerability in LenovoVariable SMI Handler due to insufficient validation in some Lenovo Notebook models that may allow an attacker with local access and elevated privileges to execute arbitrary code.
It is used by the firmware to store various information, including the product name, motherboard model name and version, OEM OS license, etc.
CVE-2021-3971
SecureBackDoor disables Serial Peripheral Interface, or SPI, flash protections. This vulnerability is in a driver used during older manufacturing processes on some consumer Lenovo Notebook devices, where it is mistakenly included in the BIOS image. This could allow an attacker with elevated privileges to modify the firmware protection region by modifying an NVRAM variable.
“The researchers indicated that this code was only meant for pre-production laptops and was mistakenly left in for the production stage. Whether a mistake, an oversight, or even intentional – this raises serious questions about how Lenovo handled its code release,” Avivi says.
Smolár says that these affected firmware drivers can be activated by an attacker to directly disable SPI flash protections – which are BIOS control register bits and protected range registers – or the UEFI secure boot feature from a privileged user mode process during OS runtime.
The researchers also say that the UEFI firmware resides in the embedded flash memory chip located on the computer’s motherboard, or SPI flash chip, which is nonvolatile memory and is connected to the processor via the SPI.
“This memory is not affected by operating system reinstallation and therefore presents a tempting target for threat actors deploying their implants – as was the case of LoJax, MosaicRegressor and MoonBounce,” they say.
The researchers say that they found firmware drivers affected by CVE-2021-3971 named SecureBackDoor and SecureBackDoorPeim. On further analysis, the researchers discovered that other Lenovo drivers – ChgBootDxeHook and ChgBootSmm – shared common characteristics with the SecureBackDoor drivers.
“As it turned out, their functionality was even more interesting and could be abused to disable UEFI Secure Boot (CVE-2021-3972),” they say.
CVE-2021-3972
ChgBootDxeHook disables UEFI Secure Boot. The researchers say that this vulnerability allows attackers with elevated privileges “to change various UEFI firmware settings, including the UEFI Secure Boot state, or, for example, restoring the UEFI firmware factory settings, all by simply creating one UEFI variable.”
“A potential vulnerability by a driver used during manufacturing process on some consumer Lenovo Notebook devices, that was mistakenly not deactivated, may allow an attacker with elevated privileges to modify secure boot setting by modifying an NVRAM variable,” Lenovo says of CVE-2021-3972 in its advisory.
The researchers say that while disabling UEFI Secure Boot, the firmware will not enforce an integrity verification of the UEFI drivers and applications during the boot process. This will allow loading of any untrusted or malicious ones, they say. Restoring factory settings will not disable UEFI Secure Boot, but will potentially expose a system to the risk of deploying some UEFI applications, such as bootloaders, with known vulnerabilities such as BootHole, allowing a bypass of UEFI Secure Boot.
UEFI Concerns
A large number of high-impact UEFI firmware vulnerabilities have been publicly disclosed recently.
In 2020, researchers at security firms Eclypsium and Advanced Intelligence found that Trickbot malware was updated with a bootkit module, nicknamed Trickboot, which can search for UEFI/BIOS firmware vulnerabilities. These flaws, if exploited, can give an attacker the ability to brick a device, which renders it damaged beyond repair due to corrupted firmware.
The pairing of Trickbot with a bootkit enables an attacker to automate a search for vulnerable devices.
Also in 2020, a Chinese-speaking hacking group used a UEFI bootkit dubbed “MosaicRegressor” to target nongovernment organizations and diplomatic missions with an espionage campaign for two years.
“The spike suggests that UEFI threats are a lot easier for cybercriminals to carry out than many people in the industry first assumed. And the growing number of them suggests that cybercriminals are aware of this too,” says CEO and co-founder of UK security firm CyberSmart, Jamie Akhtar.