Vulnerabilities / Threats

3/6/2018
06:00 PM
Connect Directly
Twitter
LinkedIn
RSS
E-Mail
50%
50%

Design Weakness in Microsoft CFG Allows Complete Bypass

Researchers from Italy's University of Padua will demo a new technique to evade Control Flow Guard, the widely deployed security mechanism, at Black Hat Asia.

A widely deployed security mechanism in Windows that is designed to prevent attackers from exploiting memory corruption errors can be completely bypassed because of a fundamental design weakness, according to researchers from the University of Padua, in Italy.

In a talk at the upcoming Black Hat Asia conference in Singapore later this month, the researchers plan to show how attackers can exploit the design weakness to execute code of their choice running in the application's context.

The design flaw exists in Control Flow Guard (CFG), a mechanism that Microsoft has implemented in all Windows operating systems from Windows 8.1 to the latest version of Windows 10. CFG, like Microsoft's Address Space Randomization Layer (ASLR), is one of several countermeasures that have been deployed in recent years to protect against exploits targeting memory corruption vulnerabilities in software. More than 500 million Windows systems have the feature currently.

As the researchers from the University of Padua explain in a technical paper describing their exploit, CFG is designed to prevent attackers from hijacking a program's control flow and directing it toward their own malicious code. The mechanism works by ensuring the order in which a program executes functions — or its control flow — follows specific valid paths.

CFG restricts indirect calls or jumps — for example, via function pointers — to an "allowed" target set determined at compile time, says Andrea Biondo, a computer science student at the University of Padua. "So, an attacker can't just hijack execution to arbitrary locations."

But some trade-offs Microsoft made in CFG to accommodate performance and backward compatibility requirements have created an opening for attackers. The CFG design vulnerability gives attackers a way to call portions of code — or gadgets — that should not be allowed and that can be chained together to bypass CFG restrictions entirely, according to the paper.

"The [control flow] restriction is precise only when the allowed targets are aligned to 16 bytes," Biondo says. "If they are not, then there is a 16-byte imprecision around the target" that attackers can take advantage of to bypass CFG, he notes.

An evaluation of Windows system libraries uncovered many exploitable gadgets in code loaded by almost all Windows applications on 32-bit systems and Web browsers on 64-bit systems, they said. "By combining the presence of unaligned targets in common libraries with the predictability of the layout of functions generated by the compiler, we can bypass CFG," Biondi says.

A 16-byte imprecision might not look like the end of the world at first sight, he adds. However, it is actually very significant since the compiler leaves so many unaligned targets around.

The researchers have dubbed their exploit as the Back to the Epilogue (BATE) attack and have described it as a generic bypass for Microsoft's Control Flow Guard. The proof-of-concept code that the researchers plan to present at Black Hat applies BATE on Microsoft's Edge browser on Windows 10 (64-bit), Biondo says. The Edge vulnerabilities used are long known, and the goal is purely to demonstrate that BATE can be exploited in real-world attacks.

According to Biondo, BATE is different from other flow integrity bypass techniques such as Endgame's Counterfeit Object-Oriented Programming (COOP) from last August.

"With those, you need to write your whole payload — or at least, a first stage — with a restricted gadget," which makes it harder, he says.

BATE just bypasses CFG completely, so an attacker can then apply more common and easier code-reuse techniques for the payload. Previous bypasses were more application-specific, while BATE requires only certain common libraries to be loaded by the victim process. "On 32-bit, basically everything is exploitable because the C runtime library is exposed to BATE," Biondo says.

"To the best of our knowledge, Microsoft is going to fix this in the RS4 Windows update," he adds.

Related content:

 

Black Hat Asia returns to Singapore with hands-on technical Trainings, cutting-edge Briefings, Arsenal open-source tool demonstrations, top-tier solutions and service providers in the Business Hall. Click for information on the conference and to register.

Jai Vijayan is a seasoned technology reporter with over 20 years of experience in IT trade journalism. He was most recently a Senior Editor at Computerworld, where he covered information security and data privacy issues for the publication. Over the course of his 20-year ... View Full Bio

Comment  | 
Print  | 
More Insights
Comments
Oldest First  |  Newest First  |  Threaded View
6 Ways Greed Has a Negative Effect on Cybersecurity
Joshua Goldfarb, Co-founder & Chief Product Officer, IDRRA ,  6/11/2018
Weaponizing IPv6 to Bypass IPv4 Security
John Anderson, Principal Security Consultant, Trustwave Spiderlabs,  6/12/2018
'Shift Left' & the Connected Car
Rohit Sethi, COO of Security Compass,  6/12/2018
Register for Dark Reading Newsletters
White Papers
Video
Cartoon
Current Issue
Flash Poll
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2018-12026
PUBLISHED: 2018-06-17
During the spawning of a malicious Passenger-managed application, SpawningKit in Phusion Passenger 5.3.x before 5.3.2 allows such applications to replace key files or directories in the spawning communication directory with symlinks. This then could result in arbitrary reads and writes, which in tur...
CVE-2018-12027
PUBLISHED: 2018-06-17
An Insecure Permissions vulnerability in SpawningKit in Phusion Passenger 5.3.x before 5.3.2 causes information disclosure in the following situation: given a Passenger-spawned application process that reports that it listens on a certain Unix domain socket, if any of the parent directories of said ...
CVE-2018-12028
PUBLISHED: 2018-06-17
An Incorrect Access Control vulnerability in SpawningKit in Phusion Passenger 5.3.x before 5.3.2 allows a Passenger-managed malicious application, upon spawning a child process, to report an arbitrary different PID back to Passenger's process manager. If the malicious application then generates an e...
CVE-2018-12029
PUBLISHED: 2018-06-17
A race condition in the nginx module in Phusion Passenger 3.x through 5.x before 5.3.2 allows local escalation of privileges when a non-standard passenger_instance_registry_dir with insufficiently strict permissions is configured. Replacing a file with a symlink after the file was created, but befor...
CVE-2018-12071
PUBLISHED: 2018-06-17
A Session Fixation issue exists in CodeIgniter before 3.1.9 because session.use_strict_mode in the Session Library was mishandled.