Baseline is Fragile: On the Effectiveness of Stack Pivot Defense
Fei Yan, Fan Huang, Lei Zhao, Huirong Peng and Qian Wang
Key Laboratory of Aerospace Information Security and Trusted Computing, Ministry of Education, Wuhan, Hubei, China
School of Computer, Wuhan University, Wuhan, 430072, China
Email: yanfei@whu.edu.cn, huangfana7@whu.edu.cn
Abstract—Return-Oriented Programming (ROP) has become
a widespread technique in recent software exploits. Various
defenses have been proposed to thwart ROP, including ran-
domization, Control-Flow Integrity (CFI), etc. However, ROP
attacks have not been eliminated completely yet. Recently, ROP
defenses based on stack pivot detection are put forward. In
this paper, we investigate the checking mechanism in existing
stack pivot defenses, including ROPGuard, Microsoft EMET,
PBlocker and a detecting device design. They check validity of
stack pointer with stack boundary information stored in system
structure, e.g., Thread Information Block (TIB) in Windows.
These stack pivot checkers are effective to detect ROP attacks
on the premise that the baseline is safely stored. However, we
find this assumption is unreliable because users have read-write
access to TIB structure, which means stack range information
can be tampered in user mode by an attacker, while existing
solutions don’t mention how to protect these baseline data. In
this paper, we propose an attack method to bypass stack pivot
checks through corrupting stack border value in TIB and prove
that our attack can overcome current solutions indeed through
case studies. Further, we discuss possible countermeasures to
enhance security of current stack pivot defenses.
Keywords-Code reuse attack, Return-Oriented Program-
ming, Stack pivot, Thread Information Block, Enhanced Mit-
igation Experience Toolkit
I. INTRODUCTION
In modern computer systems, there are various mem-
ory corruption vulnerabilities, such as buffer overflow, in-
teger overflow, format string vulnerability, and use-after-
free (UAF), which are often exploited in software exploits.
Originally, an attacker typically hijacks the control flow of
a program and switches to injected shellcode. Since data
execution prevention (DEP) [1] is widely used, code reuse
attack has become a new option. Currently, Return-Oriented
Programming (ROP) [2] is a prevalent code-reuse technique
where an attacker combines short instruction sequences
called “gadgets” originated from existing code pieces.
ROP has been successfully applied to different architec-
tures, such as x86 [2], SPARC [3], ARM [4], Atmel [5],
PowerPC [6], and ARM/iOS [7]. To defeat ROP, many solu-
tions have been put forward, such as software randomization
and control-flow integrity (CFI) [8].
This work is supported by National Natural Science Foundation of
China (No. 61272452, 61003268, 61303024), Natural Science Foundation
of Jiangsu Province (No. BK20130372), National High-tech R&D Program
of China (863 Program) 2015AA016002, and National Basic Research
Program of China (973 Program) 2014CB340601.
Software randomization diversifies the code, data, or
address space of a program so that the space layouts of
the same entities are different when running in different
system or during different execution. For example, Address
Space Layout Randomization (ASLR) [9] randomizes the
base address of modules. Besides, there are fine-grained
randomization solutions such as basic block randomization
[10] and instruction randomization [11]. However, defenses
based on diversification are commonly vulnerable when
faced with different information leakage attacks.
CFI [8] computes a Control-Flow Graph (CFG) of a pro-
gram and force the control flow to obey the rules specified
in the CFG. Depending on the accuracy of target address
set defined in specific solutions, CFI solutions are classified
as fine-grained and coarse-grained. Practical CFI solutions
[12, 13] often implement coarse-grained policies to keep
performance, leaving open the possibility of being attacked
[14]. Fine-grained CFI suffers from heavy overhead, and
CFB [15] and Control Jujutsu [16] shows that current fine-
grained CFI protections may not be secure enough.
Although above defenses indeed raise the thresholds for
ROP attack, they have different limitations and cannot
eliminate ROP attacks completely. Therefore, some re-
searchers have changed their concentration to other defense
techniques, for example, detecting the abnormity of stack
pointer [17–20], which is caused by stack pivoting in ROP
attacks. Such solutions usually have low run-time overhead
and support incremental deployment which means protected
modules can interact with unprotected modules normally.
This paper makes four contributions:
• We investigate existing stack pivot defenses and find
a weakness in their solutions where stack information
stored in TIB is the baseline to determine abnormity of
stack pointer. TIB, a read-write structure in user space,
can be compromised with some tricks, while current
solutions don’t mention how to protect it.
• Exploiting the weakness, we present an attack method
to bypass stack pivot defenses through constructing a
special ROP chain to rewrite stack boundary values.
• To verify the effectiveness of our attack, we implement
a proof of concept (POC) program and give case studies
on existing solutions. The cases show that our attack
can successfully manipulate the stack boundary value
and bypass these solutions.
2016 IEEE 22nd International Conference on Parallel and Distributed Systems
1521-9097/16 $31.00 © 2016 IEEE
DOI 10.1109/ICPADS.2016.60
406