Security Experts:

Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Malware & Threats

Researchers Use Intel SGX to Conceal Malware, Extract Private Keys

A group of researchers from Austria’s Graz University of Technology have demonstrated that malware running on Intel SGX (Software Guard Extensions) can attack the host and can be used to extract RSA private keys.

A group of researchers from Austria’s Graz University of Technology have demonstrated that malware running on Intel SGX (Software Guard Extensions) can attack the host and can be used to extract RSA private keys.

SGX, an isolation mechanism introduced by Intel in their micro-processors to protect code and data from modification or disclosure, uses special execution environments called enclaves and which work in encrypted memory area, thus protecting an application’s secrets from attackers. According to Intel, cryptographic keys should be stored inside enclaves, because they can thwart side-channel attacks.

While some argued before that the hardware-supported isolation could result in super malware inside enclaves, others refuted the fears, saying that enclaves always run with user space privileges and cannot perform any I/O operations. In a newly published paper (PDF), Graz University of Technology researchers prove that enclave malware can indeed attack its hosting system.

“We demonstrate a cache attack from within a malicious enclave that is extracting secret keys from co-located enclaves. Our proof-of-concept malware is able to recover RSA keys by monitoring cache access patterns of an RSA signature process in a semi-synchronous attack. The malware code is completely invisible to the operating system and cannot be analyzed due to the isolation provided by SGX,” the paper reads.

This attack, the report says, is the first malware running on real SGX hardware that abuses the SGX protection features to conceal itself. The researchers were able to demonstrate the attack both in a native environment and across multiple Docker containers and explain that they performed a Prime+Probe cache side-channel attack on a co-located SGX enclave running an up-to-date RSA implementation that was using a constant-time multiplication primitive.

The attack was successful despite the lack of timers, large pages, physical addresses, and shared memory in SGX enclaves. Moreover, the researchers were able to extract 96% of an RSA private key from a single trace in a semi-synchronous attack, and even managed to “extract the full RSA private key in an automated attack from 11 traces within 5 minutes.”

The paper reveals that both the target program (which uses SGX to protect an RSA signing application) and the malicious application are unprivileged and run on the same host machine. The malware keeps the attack code inside an SGX enclave to avoid detection, with the loader being used only to start the enclave. The malware can remain undetected even if state-of-the-art malware detection software is used, the researchers say.

Countermeasures to prevent such attacks are also proposed: exponent blinding and bit slicing at source level; enclave coloring, removing access to high-resolution timers, allowing cloud provider to access and scan enclaves for malicious activities, heap randomization, and Intel CAT (cache allocation technology) at OS level; and combining Intel CAT with SGX and using secure RAM at hardware level.

“Besides not fully preventing malicious enclaves, SGX provides protection features to conceal attack code. Even the most advanced detection mechanisms using performance counters cannot detect our malware. Intel intentionally does not include SGX activity in the performance counters for security reasons. However, this unavoidably provides attackers with the ability to hide attacks as it eliminates the only known technique to detect cache side-channel attacks,” the researchers say.

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join this webinar to learn best practices that organizations can use to improve both their resilience to new threats and their response times to incidents.

Register

Join this live webinar as we explore the potential security threats that can arise when third parties are granted access to a sensitive data or systems.

Register

Expert Insights

Related Content

Cybercrime

The changing nature of what we still generally call ransomware will continue through 2023, driven by three primary conditions.

Cybercrime

No one combatting cybercrime knows everything, but everyone in the battle has some intelligence to contribute to the larger knowledge base.

Cybercrime

A recently disclosed vBulletin vulnerability, which had a zero-day status for roughly two days last week, was exploited in a hacker attack targeting the...

Malware & Threats

Threat actors are increasingly abusing Microsoft OneNote documents to deliver malware in both targeted and spray-and-pray campaigns.

Malware & Threats

A vulnerability affecting IBM’s Aspera Faspex file transfer solution, tracked as CVE-2022-47986, has been exploited in attacks.

Malware & Threats

Microsoft plans to improve the protection of Office users by blocking XLL add-ins from the internet.

Malware & Threats

Unpatched and unprotected VMware ESXi servers worldwide have been targeted in a ransomware attack exploiting a vulnerability patched in 2021.

Cybercrime

More than 3,800 servers around the world have been compromised in recent ESXiArgs ransomware attacks, which also include an improved process.