At BlackHat today, Bitdefender disclosed a new variant of the Spectre 1 speculative execution side channel vulnerabilities that could allow a malicious program to access and read the contents of privileged memory in an operating system.
This SWAPGS vulnerability allows local programs, like malware, to read data from memory that is should normally not have access to, such as the Windows or Linux kernel memory.
Andrei Vlad Lutas of Bitdefender discovered this vulnerability while performing research on CPU internals and reported it to Intel in August 2018.
In a statement from Intel, BleepingComputer was told that after the vulnerability was disclosed to them, they descided to address this on a software level and Microsoft took over coordination of the vulnerability.
“Intel, along with industry partners, determined the issue was better addressed at the software level and connected the researchers to Microsoft. It takes the ecosystem working together to collectively keep products and data more secure and this issue is being coordinated by Microsoft.”
From that point forward, Microsoft took over notifying other vendors, making sure patches were released, and planning the coordinated disclosure today at BlackHat.
The SWAPGS Vulnerability
The SWAPGS vulnerability is a speculative execution side-channel vulnerability that allows bad actors to read data from privileged memory.
In order to increase performance in CPUs, a feature called speculative execution will execute instructions before it knows if they are needed or not. Vulnerabilities that target this feature are called side-channel attacks.
In a new side-channel attack discovered by Bitdefender, attackers “break the memory isolation provided by the CPU, allowing an unprivileged attacker to access privileged, kernel memory.”
This is done through the SWAPGS instruction found in 64-bit CPUs that when manipulated successfully can be used to leak sensitive information from kernel memory even when the malicious process is running with low user permissions.
This could allow attackers to steal any type of information that is stored in the memory, including chat messages, emails, login credentials, payment information, passwords, encryption keys, tokens, or access credentials.
What it comes down to, is that no information can be kept secret.
While Microsoft, Intel, and Red Hat all state that this vulnerability exists in all modern CPUs, Bitdefender says they have only been able to successfully exploit the vulnerability on Intel CPUs.
“We tested two AMD CPUs: AMD64 Family 16 Model 2 Stepping 3 AuthenticAMD ~3211 Mhz and AMD64 Family 15 Model 6 Stepping 1 AuthenticAMD ~2100 Mhz and neither exhibited speculative behavior for the SWAPGS instruction.
Since the SWAPGS instruction is present only on x86-64, we don’t expect other CPU architectures, such as ARM, MIPS, POWER, SPARC or RISC-V to be vulnerable. However, we don’t exclude the existence of other similarly sensitive instructions that may execute speculatively.”
Furthermore, as the required WRGSBASE instruction is only present in CPUs starting with Ivy Bridge, Bitdefender expects older CPUS “to be much more difficult, if not impossible to exploit.”
For more detailed information about the SWAPGS vulnerability, you can visit Bitdefender’s dedicated SWAPGS page.
Vendors respond to SWAPGS vulnerability
In a coordinated disclosure, numerous vendors including Microsoft, Red Hat, Intel, and Google have released advisories regarding this vulnerability.
Below we have a provided more information on the advisories and updates released by vendors to mitigate this issue.
Microsoft secretly fixes vulnerability in July updates
During the July 2019 Patch Tuesday security updates, Microsoft secretly patched the new SWAPGS speculative vulnerability using software mitigations. If you install Windows security updates as they come out, then you are already protected from this vulnerability in Windows.
Microsoft’s advisory that was released today is titled “Windows Kernel Information Disclosure Vulnerability” and was held back on being released until today as part of a coordinated industry disclosure.
According to Microsoft, Andrei Vlad Lutas of Bitdefender discovered this new vulnerability in some modern CPUs that would allow malicious user mode programs to access and read the contents of the Windows Kernel memory.
“To exploit this vulnerability, an attacker would have to log on to an affected system and run a specially crafted application,” Microsoft explained in their advisory. “The vulnerability would not allow an attacker to elevate user rights directly, but it could be used to obtain information that could be used to try to compromise the affected system further.”
To resolve this vulnerability, a Windows security update was released on July 9th, 2019, that fixes the vulnerability through software changes that mitigate how a CPU speculatively accesses memory. Microsoft further stated that it is not required to install a microcode update to resolve this vulnerability.
“Customers who have Windows Update enabled and have applied the security updates released on July 9, 2019 are protected automatically. There is no further configuration necessary.”
It is not known if these software changes will have any effect on Windows performance like previous mitigations.
Microsoft has shared the following statement with BleepingComputer regarding this vulnerability:
“We’re aware of this industry-wide issue and have been working closely with affected chip manufacturers and industry partners to develop and test mitigations to protect our customers. We released security updates in July and customers who have Windows Update enabled and applied the security updates are protected automatically.”
Red Hat releases updated kernels
Red Hat has also released an advisory regarding this latest Spectre variant titled “CVE-2019-1125: Spectre SWAPGS gadget vulnerability”.
Red Hat users can fix this vulnerability by updating the kernel and installing the latest microcode updates.
“Red Hat has been made aware of an additional spectre-V1 like attack vector, requiring updates to the Linux kernel in combination with microcode updates. This additional attack vector builds on existing software fixes shipped in previous kernel and microcode updates. This vulnerability only applies to x86-64 systems using either Intel or AMD processors.”
Intel releases advisory
Intel has released an advisory regarding the SWAPGS vulnerability. This basically rehashes what other vendors have stated.
After assessing this issue with industry partners, we determined that the best mitigation would be at the software layer. Microsoft agreed to coordinate remediation efforts, working with the researchers and other industry partners. Microsoft released their software update to address this issue in July 2019 and today published their security advisory as part of the CVD process.
Some Linux* OS vendors may elect to release updates for their products. Please check with your Linux OS vendor for details.
Google adds SWAPGS fix to ChromeOS 4.19 and Android 4.19
Google has added fixes for this vulnerability to ChromeOS 4.19, which is expected to be released soon.
Gustavo A. R. Silva (1): IB/hfi1: Fix Spectre v1 vulnerability Josh Poimboeuf (7): x86/speculation: Prepare entry code for Spectre v1 swapgs mitigations x86/speculation: Enable Spectre v1 swapgs mitigations x86/entry/64: Use JMP instead of JMPQ Documentation: Add swapgs description to the Spectre v1 documentation
In a bug report found by BleepingComputer, Google has merged SWAPGS patches into ChromeOS 4.19 and updated their Spectre admin-guide to include information about this vulnerability.
“An attacker can train the branch predictor to speculatively skip the swapgs path for an interrupt or exception. If they initialize the GS register to a user-space value, if the swapgs is speculatively skipped, subsequent GS-related percpu accesses in the speculation window will be done with the attacker-controlled GS value. This could cause privileged memory to be accessed and leaked.”
This same fix was also added to Android 4.19 per a commit found by BleepingComputer on the Android Gerrit.
x86/speculation: Prepare entry code for Spectre v1 swapgs mitigations x86/speculation: Enable Spectre v1 swapgs mitigations x86/entry/64: Use JMP instead of JMPQ x86/speculation/swapgs: Exclude ATOMs from speculation through SWAPGS Documentation: Add swapgs description to the Spectre v1 documentation
As more vendors release advisories, we will update this story.
>> Source Link