SlideShare a Scribd company logo
On the Effectiveness of Type-based
Control Flow Integrity
Reza Mirzazade farkhani, Saman Jafari, Sajjad Arshad,
William Robertson, Engin Kirda, Hamed Okhravi
DISTRIBUTION STATEMENT A. Approved for public release. Distribution is unlimited.
This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8702-15-D-0001. Any opinions,
findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Assistant Secretary of Defense for
Research and Engineering.
© 2016 Massachusetts Institute of Technology.
Delivered to the US Government with Unlimited Rights, as defined in DFARS Part 252.227-7013 or 7014 (Feb 2014). Notwithstanding any copyright notice, U.S. Government rights in
this work are defined by DFARS 252.227-7013 or DFARS 252.227-7014 as detailed above. Use of this work other than as specifically authorized by the U.S. Government may violate
any copyrights that exist in this work.
Outline
● Control Flow Hijacking
● Control Flow Integrity (CFI)
● Runtime Type Checking (RTC)
● Reuse Attack Protector (RAP)
● Typed ROP (TROP)
● PoC Exploit for Nginx
● Evaluation
● Conclusion
2
Control Flow Hijacking
● Memory Corruption can lead to violation of Control Flow Graph (CFG)
3
...
call *fptr1
…
jmp *fptr2
...
func1:
…
ret
func2:
…
ret
malicious:
…
Forward Edges (calls, jumps)
…
call func3
…
func3:
…
ret
malicious:
…
Backward Edges (return addresses)
Control Flow Integrity (CFI)
● CFI prevents control flow hijacking by enforcing CFG at runtime
● CFG is usually generated statically using Points-to Analysis
○ DSA: Data Structure Analysis
○ SVF: Static Value-Flow (interprocedural analysis)
■ Support developing different analyses (flow-, field-sensitivity)
● Constructing Sound and Precise CFGs is undecidable and impractical
4
Runtime Type Checking (RTC)
● Runtime Type Checking (RTC) generates the CFG based on Type Signature
● RTC matches the type signature of each indirect control transfer with its target
● Forward edge
○ The type of function pointer and the target are checked at each control transfer
● Backward edge
○ The type of callee is checked during the function epilogue
● Implementations
○ Reuse Attack Protector (RAP), LLVM-CFI, KCFI (Kernel CFI), MCFI (Modular CFI), TypeArmor
5
Reuse Attack Protector (RAP)
6
Reuse Attack Protector (RAP)
7
typedef void (*fptr) ( int , long )
void func1 ( int i, long j)
void func2 ( int m, long n)
hash: 5d769299
hash: 5d769299
Return
Type
Parameters
Type
hash: 5d769299
Reuse Attack Protector (RAP)
8
Type
Collision
typedef void (*fptr) ( int , long )
void func1 ( int i, long j)
void func2 ( int m, long n)
hash: 5d769299
hash: 5d769299
Return
Type
Parameters
Type
hash: 5d769299
Sample Vulnerable Program
9
hash2
…
call linker_func()
invalid_target()
hash3
…
call final_target()
linker_func()
hash4
...
call execve()
final_target()
hash1
...
call (*fptr)
vulnerable()
hash2
...
valid_target1()
hash2
...
valid_target2()
constraint
Research Questions
● Can RTC be practically bypassed using type collisions?
● Are there enough intermediate functions with satisfiable constraints in real-world
applications?
● How prevalent are these constructs in real-world applications?
10
Threat Model
● The attacker has arbitrary read and write primitives to the memory
● The application contains one strong or multiple limited memory corruption
vulnerabilities
● DEP and ASLR are enabled
● RAP is in place
11
Typed ROP (TROP)
12
Typed ROP (TROP)
ngx_process_cycle.c:73:1: note: func
rap_hash: 2858705e
ngx_master_process_cycle
ngx_process_cycle.c:315:21: note: fptr
rap_hash: 2858705e
cycle->modules[i]->exit_process(cycle)
13
Typed ROP (TROP)
ngx_process_cycle.c:73:1: note: func
rap_hash: 2858705e
ngx_master_process_cycle
ngx_process_cycle.c:315:21: note: fptr
rap_hash: 2858705e
cycle->modules[i]->exit_process(cycle)
Building
CG, CFG
14
Typed ROP (TROP)
ngx_process_cycle.c:73:1: note: func
rap_hash: 2858705e
ngx_master_process_cycle
ngx_process_cycle.c:315:21: note: fptr
rap_hash: 2858705e
cycle->modules[i]->exit_process(cycle)
Building
CG, CFG
Finding
Gadgets
15
Gadgets
16
…
call (*fptr)
…
Linker Gadgets
(L-Gadgets)
Execution Gadget
(E-Gadgets)
Collision Gadget
(C-Gadgets)
Over Approximation
Legitimate Target
loop
Indirect call
Direct call
Ideal L-Gadget
Useless L-Gadget
Typed ROP (TROP)
ngx_process_cycle.c:73:1: note: func
rap_hash: 2858705e
ngx_master_process_cycle
ngx_process_cycle.c:315:21: note: fptr
rap_hash: 2858705e
cycle->modules[i]->exit_process(cycle)
Building
CG, CFG
Finding
Gadgets
Detecting
Candidate
Paths
17
Typed ROP (TROP)
ngx_process_cycle.c:73:1: note: func
rap_hash: 2858705e
ngx_master_process_cycle
ngx_process_cycle.c:315:21: note: fptr
rap_hash: 2858705e
cycle->modules[i]->exit_process(cycle)
Building
CG, CFG
Finding
Gadgets
Constraint
Solving
Detecting
Candidate
Paths
Exploits
18
PoC Exploits (Nginx)
19
PoC Exploits (Nginx)
20
...
check 2858705e hash
call (*exit_process)
hash 2858705e
...
ngx_worker_process_exit
ngx_conf_flush_files()
static void
ngx_worker_process_exit(ngx_cycle_t *cycle) {
ngx_uint_t i;
ngx_connection_t *c;
for (i = 0; cycle->modules[i]; i++) {
if (cycle->modules[i]->exit_process) {
cycle->modules[i]->exit_process(cycle);
}
}
…
}
PoC Exploits (Nginx)
21
...
check 2858705e hash
call (*exit_process)
hash 2858705e
...
ngx_worker_process_exit
ngx_conf_flush_files()
hash 2858705e
call ngx_reap_children()
...
ngx_master_process_cycle()
C-Gadget
void
ngx_master_process_cycle(ngx_cycle_t * cycle) {
…
/* By setting this condition to true, the attacker can
* reach to the next gadget which is ngx_reap_children()
*/
if (ngx_reap) {
ngx_reap = 0;
ngx_log_debug0(NGX_LOG_DEBUG_EVENT,
cycle, log, 0, "reap children");
live = ngx_reap_children(cycle);
…
…
}
PoC Exploits (Nginx)
22
...
check 2858705e hash
call (*exit_process)
hash 2858705e
...
ngx_worker_process_exit
ngx_conf_flush_files()
hash 2858705e
call ngx_reap_children()
...
ngx_master_process_cycle()
...
call ngx_spawn_process()
...
ngx_reap_children()
L-GadgetsC-Gadget
static ngx_uint_t
ngx_reap_children(ngx_cycle_t * cycle) {
…
for (i = 0; i < ngx_last_process; i++) {
…
if (ngx_processes[i].respawn &&
!ngx_processes[i].exiting &&
!ngx_terminate &&
!ngx_quit) {
if (ngx_spawn_process(cycle,
ngx_processes[i].proc,
ngx_processes[i].data,
ngx_processes[i].name, i)
== NGX_INVALID_PID) {
…
PoC Exploits (Nginx)
23
...
check 2858705e hash
call (*exit_process)
hash 2858705e
...
ngx_worker_process_exit
ngx_conf_flush_files()
hash 2858705e
call ngx_reap_children()
...
ngx_master_process_cycle()
...
call ngx_spawn_process()
...
ngx_reap_children()
...
check 6e956407 hash
call (*proc)
ngx_spawn_process()
L-GadgetsC-Gadget
ngx_pid_t ngx_spawn_process(ngx_cycle_t *cycle,
ngx_spawn_proc_pt proc, void *data, char *name,
ngx_int_t respawn) {
…
switch (pid) {
case -1:
…
case 0:
ngx_pid = ngx_getpid();
proc(cycle, data);
…
}
PoC Exploits (Nginx)
24
...
check 2858705e hash
call (*exit_process)
hash 2858705e
...
ngx_worker_process_exit
ngx_conf_flush_files()
hash 2858705e
call ngx_reap_children()
...
ngx_master_process_cycle()
...
call ngx_spawn_process()
...
ngx_reap_children()
...
check 6e956407 hash
call (*proc)
ngx_spawn_process()
hash 6e956407
...
call execve()
ngx_execute_proc()
E-Gadget
L-GadgetsC-Gadget
static void
ngx_execute_proc(ngx_cycle_t *cycle, void *data) {
ngx_exec_ctx_t * ctx = data;
if (execve(ctx->path, ctx->argv, ctx->envp) == -1) {
ngx_log_error(NGX_LOG_ALERT,
cycle -> log,
ngx_errno,
"execve() failed while executing %s"%s"",
ctx -> name, ctx -> path);
}
exit(1);
}
● Type Collisions
● Gadget Distribution
● Libc
● Type Checking vs. Points-to Analysis
● Type Diversification
● Practical Challenges
Evaluation
25
Type Collisions
26
Gadget Distribution
27
Libc (Targets)
28
Libc (Edges)
29
Type Checking vs. Points-to Analysis
30
Type Diversification
31
void (*fptr)(int)
void valid_target2(int)
void invalid_target1(int)
void invalid_target2(int)
void valid_target1(int)
● Complicates separate compilation
Type Diversification
32
void (*fptr)(int)
void valid_target2(int)
void invalid_target1(int_1)
void invalid_target2(int_1)
void valid_target1(int)
● Mismatch Types
○ void * can point to any pointer (e.g., int *)
● Support for Assembly Code
Practical Challenges
33
Conclusion
● Evaluated RTC from security and practicality perspectives
● Type collisions between function pointers and E-Gadgets are rare
● TROP showed collisions with other functions in a nested fashion can be exploited
● Gadgets for mounting TROP are abundant in real-world applications
● RTC is a practical defense but not sufficient to prevent control flow hijacking
34
Questions?
Reza Mirzazade farkhani
reza699@ccs.neu.edu
35

More Related Content

Similar to On the Effectiveness of Type-based Control Flow Integrity

PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
Rouven Weßling
 
Lnx eng traffic_control-1.0.7-compact
Lnx eng traffic_control-1.0.7-compactLnx eng traffic_control-1.0.7-compact
Lnx eng traffic_control-1.0.7-compact
Alessandro Selli
 
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneBang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
DroidConTLV
 
Современные технологии и инструменты анализа вредоносного ПО
Современные технологии и инструменты анализа вредоносного ПОСовременные технологии и инструменты анализа вредоносного ПО
Современные технологии и инструменты анализа вредоносного ПО
Positive Hack Days
 
Integris Security - Hacking With Glue ℠
Integris Security - Hacking With Glue ℠Integris Security - Hacking With Glue ℠
Integris Security - Hacking With Glue ℠
Integris Security LLC
 
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
Igalia
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
KAI CHU CHUNG
 
SYCL 1.2.1 Reference Card
SYCL 1.2.1 Reference CardSYCL 1.2.1 Reference Card
SYCL 1.2.1 Reference Card
The Khronos Group Inc.
 
Technical Report Vawtrak v2
Technical Report Vawtrak v2Technical Report Vawtrak v2
Technical Report Vawtrak v2
Blueliv
 
3D-DRESD Lorenzo Pavesi
3D-DRESD Lorenzo Pavesi3D-DRESD Lorenzo Pavesi
3D-DRESD Lorenzo Pavesi
Marco Santambrogio
 
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
Raimundas Banevičius
 
Kernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverKernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driver
Anne Nicolas
 
Hack any website
Hack any websiteHack any website
Hack any website
sunil kumar
 
Search-driven String Constraint Solving for Vulnerability Detection
Search-driven String Constraint Solving for Vulnerability DetectionSearch-driven String Constraint Solving for Vulnerability Detection
Search-driven String Constraint Solving for Vulnerability Detection
Lionel Briand
 
Async programming on NET
Async programming on NETAsync programming on NET
Async programming on NET
yuyijq
 
Protocol handler in Gecko
Protocol handler in GeckoProtocol handler in Gecko
Protocol handler in Gecko
Chih-Hsuan Kuo
 
Cyber Security Forum: DARPA's Cyber Grand Challenge. What Happened and What'...
Cyber Security Forum: DARPA's Cyber Grand Challenge.  What Happened and What'...Cyber Security Forum: DARPA's Cyber Grand Challenge.  What Happened and What'...
Cyber Security Forum: DARPA's Cyber Grand Challenge. What Happened and What'...
Tim Vidas
 
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
Mr. Vengineer
 
Lucas apa pacsec slides
Lucas apa pacsec slidesLucas apa pacsec slides
Lucas apa pacsec slides
PacSecJP
 
망고100 보드로 놀아보자 15
망고100 보드로 놀아보자 15망고100 보드로 놀아보자 15
망고100 보드로 놀아보자 15
종인 전
 

Similar to On the Effectiveness of Type-based Control Flow Integrity (20)

PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
 
Lnx eng traffic_control-1.0.7-compact
Lnx eng traffic_control-1.0.7-compactLnx eng traffic_control-1.0.7-compact
Lnx eng traffic_control-1.0.7-compact
 
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneBang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
 
Современные технологии и инструменты анализа вредоносного ПО
Современные технологии и инструменты анализа вредоносного ПОСовременные технологии и инструменты анализа вредоносного ПО
Современные технологии и инструменты анализа вредоносного ПО
 
Integris Security - Hacking With Glue ℠
Integris Security - Hacking With Glue ℠Integris Security - Hacking With Glue ℠
Integris Security - Hacking With Glue ℠
 
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
 
SYCL 1.2.1 Reference Card
SYCL 1.2.1 Reference CardSYCL 1.2.1 Reference Card
SYCL 1.2.1 Reference Card
 
Technical Report Vawtrak v2
Technical Report Vawtrak v2Technical Report Vawtrak v2
Technical Report Vawtrak v2
 
3D-DRESD Lorenzo Pavesi
3D-DRESD Lorenzo Pavesi3D-DRESD Lorenzo Pavesi
3D-DRESD Lorenzo Pavesi
 
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
The Next Step in AS3 Framework Evolution - FITC Amsterdam 2013
 
Kernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverKernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driver
 
Hack any website
Hack any websiteHack any website
Hack any website
 
Search-driven String Constraint Solving for Vulnerability Detection
Search-driven String Constraint Solving for Vulnerability DetectionSearch-driven String Constraint Solving for Vulnerability Detection
Search-driven String Constraint Solving for Vulnerability Detection
 
Async programming on NET
Async programming on NETAsync programming on NET
Async programming on NET
 
Protocol handler in Gecko
Protocol handler in GeckoProtocol handler in Gecko
Protocol handler in Gecko
 
Cyber Security Forum: DARPA's Cyber Grand Challenge. What Happened and What'...
Cyber Security Forum: DARPA's Cyber Grand Challenge.  What Happened and What'...Cyber Security Forum: DARPA's Cyber Grand Challenge.  What Happened and What'...
Cyber Security Forum: DARPA's Cyber Grand Challenge. What Happened and What'...
 
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
 
Lucas apa pacsec slides
Lucas apa pacsec slidesLucas apa pacsec slides
Lucas apa pacsec slides
 
망고100 보드로 놀아보자 15
망고100 보드로 놀아보자 15망고100 보드로 놀아보자 15
망고100 보드로 놀아보자 15
 

More from Sajjad "JJ" Arshad

Cached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the WildCached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the Wild
Sajjad "JJ" Arshad
 
Cached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the WildCached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the Wild
Sajjad "JJ" Arshad
 
Cached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the WildCached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the Wild
Sajjad "JJ" Arshad
 
HotFuzz: Discovering Algorithmic Denial-of-Service Vulnerabilities Through Gu...
HotFuzz: Discovering Algorithmic Denial-of-Service Vulnerabilities Through Gu...HotFuzz: Discovering Algorithmic Denial-of-Service Vulnerabilities Through Gu...
HotFuzz: Discovering Algorithmic Denial-of-Service Vulnerabilities Through Gu...
Sajjad "JJ" Arshad
 
Large-Scale Analysis of Style Injection by Relative Path Overwrite
Large-Scale Analysis of Style Injection by Relative Path OverwriteLarge-Scale Analysis of Style Injection by Relative Path Overwrite
Large-Scale Analysis of Style Injection by Relative Path Overwrite
Sajjad "JJ" Arshad
 
UNVEIL: A Large-Scale, Automated Approach to Detecting Ransomware
UNVEIL: A Large-Scale, Automated Approach to Detecting RansomwareUNVEIL: A Large-Scale, Automated Approach to Detecting Ransomware
UNVEIL: A Large-Scale, Automated Approach to Detecting Ransomware
Sajjad "JJ" Arshad
 
Tracing Information Flows Between Ad Exchanges Using Retargeted Ads
Tracing Information Flows Between Ad Exchanges Using Retargeted AdsTracing Information Flows Between Ad Exchanges Using Retargeted Ads
Tracing Information Flows Between Ad Exchanges Using Retargeted Ads
Sajjad "JJ" Arshad
 
How Tracking Companies Circumvent Ad Blockers Using WebSockets
How Tracking Companies Circumvent Ad Blockers Using WebSocketsHow Tracking Companies Circumvent Ad Blockers Using WebSockets
How Tracking Companies Circumvent Ad Blockers Using WebSockets
Sajjad "JJ" Arshad
 
Practical Challenges of Type Checking in Control Flow Integrity
Practical Challenges of Type Checking in Control Flow IntegrityPractical Challenges of Type Checking in Control Flow Integrity
Practical Challenges of Type Checking in Control Flow Integrity
Sajjad "JJ" Arshad
 
Understanding and Mitigating the Security Risks of Content Inclusion in Web B...
Understanding and Mitigating the Security Risks of Content Inclusion in Web B...Understanding and Mitigating the Security Risks of Content Inclusion in Web B...
Understanding and Mitigating the Security Risks of Content Inclusion in Web B...
Sajjad "JJ" Arshad
 
Identifying Extension-based Ad Injection via Fine-grained Web Content Provenance
Identifying Extension-based Ad Injection via Fine-grained Web Content ProvenanceIdentifying Extension-based Ad Injection via Fine-grained Web Content Provenance
Identifying Extension-based Ad Injection via Fine-grained Web Content Provenance
Sajjad "JJ" Arshad
 
Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Librari...
Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Librari...Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Librari...
Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Librari...
Sajjad "JJ" Arshad
 
A Longitudinal Analysis of the ads.txt Standard
A Longitudinal Analysis of the ads.txt StandardA Longitudinal Analysis of the ads.txt Standard
A Longitudinal Analysis of the ads.txt Standard
Sajjad "JJ" Arshad
 
How Tracking Companies Circumvented Ad Blockers Using WebSockets
How Tracking Companies Circumvented Ad Blockers Using WebSocketsHow Tracking Companies Circumvented Ad Blockers Using WebSockets
How Tracking Companies Circumvented Ad Blockers Using WebSockets
Sajjad "JJ" Arshad
 
"Recommended For You": A First Look at Content Recommendation Networks
"Recommended For You": A First Look at Content Recommendation Networks"Recommended For You": A First Look at Content Recommendation Networks
"Recommended For You": A First Look at Content Recommendation Networks
Sajjad "JJ" Arshad
 
Include Me Out: In-Browser Detection of Malicious Third-Party Content Inclusions
Include Me Out: In-Browser Detection of Malicious Third-Party Content InclusionsInclude Me Out: In-Browser Detection of Malicious Third-Party Content Inclusions
Include Me Out: In-Browser Detection of Malicious Third-Party Content Inclusions
Sajjad "JJ" Arshad
 

More from Sajjad "JJ" Arshad (16)

Cached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the WildCached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the Wild
 
Cached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the WildCached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the Wild
 
Cached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the WildCached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the Wild
 
HotFuzz: Discovering Algorithmic Denial-of-Service Vulnerabilities Through Gu...
HotFuzz: Discovering Algorithmic Denial-of-Service Vulnerabilities Through Gu...HotFuzz: Discovering Algorithmic Denial-of-Service Vulnerabilities Through Gu...
HotFuzz: Discovering Algorithmic Denial-of-Service Vulnerabilities Through Gu...
 
Large-Scale Analysis of Style Injection by Relative Path Overwrite
Large-Scale Analysis of Style Injection by Relative Path OverwriteLarge-Scale Analysis of Style Injection by Relative Path Overwrite
Large-Scale Analysis of Style Injection by Relative Path Overwrite
 
UNVEIL: A Large-Scale, Automated Approach to Detecting Ransomware
UNVEIL: A Large-Scale, Automated Approach to Detecting RansomwareUNVEIL: A Large-Scale, Automated Approach to Detecting Ransomware
UNVEIL: A Large-Scale, Automated Approach to Detecting Ransomware
 
Tracing Information Flows Between Ad Exchanges Using Retargeted Ads
Tracing Information Flows Between Ad Exchanges Using Retargeted AdsTracing Information Flows Between Ad Exchanges Using Retargeted Ads
Tracing Information Flows Between Ad Exchanges Using Retargeted Ads
 
How Tracking Companies Circumvent Ad Blockers Using WebSockets
How Tracking Companies Circumvent Ad Blockers Using WebSocketsHow Tracking Companies Circumvent Ad Blockers Using WebSockets
How Tracking Companies Circumvent Ad Blockers Using WebSockets
 
Practical Challenges of Type Checking in Control Flow Integrity
Practical Challenges of Type Checking in Control Flow IntegrityPractical Challenges of Type Checking in Control Flow Integrity
Practical Challenges of Type Checking in Control Flow Integrity
 
Understanding and Mitigating the Security Risks of Content Inclusion in Web B...
Understanding and Mitigating the Security Risks of Content Inclusion in Web B...Understanding and Mitigating the Security Risks of Content Inclusion in Web B...
Understanding and Mitigating the Security Risks of Content Inclusion in Web B...
 
Identifying Extension-based Ad Injection via Fine-grained Web Content Provenance
Identifying Extension-based Ad Injection via Fine-grained Web Content ProvenanceIdentifying Extension-based Ad Injection via Fine-grained Web Content Provenance
Identifying Extension-based Ad Injection via Fine-grained Web Content Provenance
 
Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Librari...
Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Librari...Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Librari...
Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Librari...
 
A Longitudinal Analysis of the ads.txt Standard
A Longitudinal Analysis of the ads.txt StandardA Longitudinal Analysis of the ads.txt Standard
A Longitudinal Analysis of the ads.txt Standard
 
How Tracking Companies Circumvented Ad Blockers Using WebSockets
How Tracking Companies Circumvented Ad Blockers Using WebSocketsHow Tracking Companies Circumvented Ad Blockers Using WebSockets
How Tracking Companies Circumvented Ad Blockers Using WebSockets
 
"Recommended For You": A First Look at Content Recommendation Networks
"Recommended For You": A First Look at Content Recommendation Networks"Recommended For You": A First Look at Content Recommendation Networks
"Recommended For You": A First Look at Content Recommendation Networks
 
Include Me Out: In-Browser Detection of Malicious Third-Party Content Inclusions
Include Me Out: In-Browser Detection of Malicious Third-Party Content InclusionsInclude Me Out: In-Browser Detection of Malicious Third-Party Content Inclusions
Include Me Out: In-Browser Detection of Malicious Third-Party Content Inclusions
 

Recently uploaded

Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
PsychoTech Services
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
Sérgio Sacani
 
Direct Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart AgricultureDirect Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart Agriculture
International Food Policy Research Institute- South Asia Office
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
University of Maribor
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
RitabrataSarkar3
 
Basics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different formsBasics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different forms
MaheshaNanjegowda
 
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Leonel Morgado
 
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
hozt8xgk
 
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of ProteinsGBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
Areesha Ahmad
 
HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1
Shashank Shekhar Pandey
 
11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf
PirithiRaju
 
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills MN
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
by6843629
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
Vandana Devesh Sharma
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
Anagha Prasad
 
Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
PirithiRaju
 
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdfAJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR
 
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
Scintica Instrumentation
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
İsa Badur
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
vluwdy49
 

Recently uploaded (20)

Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
Sexuality - Issues, Attitude and Behaviour - Applied Social Psychology - Psyc...
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
 
Direct Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart AgricultureDirect Seeded Rice - Climate Smart Agriculture
Direct Seeded Rice - Climate Smart Agriculture
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
 
Basics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different formsBasics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different forms
 
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
Describing and Interpreting an Immersive Learning Case with the Immersion Cub...
 
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
快速办理(UAM毕业证书)马德里自治大学毕业证学位证一模一样
 
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of ProteinsGBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
 
HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1
 
11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf11.1 Role of physical biological in deterioration of grains.pdf
11.1 Role of physical biological in deterioration of grains.pdf
 
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
 
Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
 
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdfAJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdf
 
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
 

On the Effectiveness of Type-based Control Flow Integrity

  • 1. On the Effectiveness of Type-based Control Flow Integrity Reza Mirzazade farkhani, Saman Jafari, Sajjad Arshad, William Robertson, Engin Kirda, Hamed Okhravi DISTRIBUTION STATEMENT A. Approved for public release. Distribution is unlimited. This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Assistant Secretary of Defense for Research and Engineering. © 2016 Massachusetts Institute of Technology. Delivered to the US Government with Unlimited Rights, as defined in DFARS Part 252.227-7013 or 7014 (Feb 2014). Notwithstanding any copyright notice, U.S. Government rights in this work are defined by DFARS 252.227-7013 or DFARS 252.227-7014 as detailed above. Use of this work other than as specifically authorized by the U.S. Government may violate any copyrights that exist in this work.
  • 2. Outline ● Control Flow Hijacking ● Control Flow Integrity (CFI) ● Runtime Type Checking (RTC) ● Reuse Attack Protector (RAP) ● Typed ROP (TROP) ● PoC Exploit for Nginx ● Evaluation ● Conclusion 2
  • 3. Control Flow Hijacking ● Memory Corruption can lead to violation of Control Flow Graph (CFG) 3 ... call *fptr1 … jmp *fptr2 ... func1: … ret func2: … ret malicious: … Forward Edges (calls, jumps) … call func3 … func3: … ret malicious: … Backward Edges (return addresses)
  • 4. Control Flow Integrity (CFI) ● CFI prevents control flow hijacking by enforcing CFG at runtime ● CFG is usually generated statically using Points-to Analysis ○ DSA: Data Structure Analysis ○ SVF: Static Value-Flow (interprocedural analysis) ■ Support developing different analyses (flow-, field-sensitivity) ● Constructing Sound and Precise CFGs is undecidable and impractical 4
  • 5. Runtime Type Checking (RTC) ● Runtime Type Checking (RTC) generates the CFG based on Type Signature ● RTC matches the type signature of each indirect control transfer with its target ● Forward edge ○ The type of function pointer and the target are checked at each control transfer ● Backward edge ○ The type of callee is checked during the function epilogue ● Implementations ○ Reuse Attack Protector (RAP), LLVM-CFI, KCFI (Kernel CFI), MCFI (Modular CFI), TypeArmor 5
  • 7. Reuse Attack Protector (RAP) 7 typedef void (*fptr) ( int , long ) void func1 ( int i, long j) void func2 ( int m, long n) hash: 5d769299 hash: 5d769299 Return Type Parameters Type hash: 5d769299
  • 8. Reuse Attack Protector (RAP) 8 Type Collision typedef void (*fptr) ( int , long ) void func1 ( int i, long j) void func2 ( int m, long n) hash: 5d769299 hash: 5d769299 Return Type Parameters Type hash: 5d769299
  • 9. Sample Vulnerable Program 9 hash2 … call linker_func() invalid_target() hash3 … call final_target() linker_func() hash4 ... call execve() final_target() hash1 ... call (*fptr) vulnerable() hash2 ... valid_target1() hash2 ... valid_target2() constraint
  • 10. Research Questions ● Can RTC be practically bypassed using type collisions? ● Are there enough intermediate functions with satisfiable constraints in real-world applications? ● How prevalent are these constructs in real-world applications? 10
  • 11. Threat Model ● The attacker has arbitrary read and write primitives to the memory ● The application contains one strong or multiple limited memory corruption vulnerabilities ● DEP and ASLR are enabled ● RAP is in place 11
  • 13. Typed ROP (TROP) ngx_process_cycle.c:73:1: note: func rap_hash: 2858705e ngx_master_process_cycle ngx_process_cycle.c:315:21: note: fptr rap_hash: 2858705e cycle->modules[i]->exit_process(cycle) 13
  • 14. Typed ROP (TROP) ngx_process_cycle.c:73:1: note: func rap_hash: 2858705e ngx_master_process_cycle ngx_process_cycle.c:315:21: note: fptr rap_hash: 2858705e cycle->modules[i]->exit_process(cycle) Building CG, CFG 14
  • 15. Typed ROP (TROP) ngx_process_cycle.c:73:1: note: func rap_hash: 2858705e ngx_master_process_cycle ngx_process_cycle.c:315:21: note: fptr rap_hash: 2858705e cycle->modules[i]->exit_process(cycle) Building CG, CFG Finding Gadgets 15
  • 16. Gadgets 16 … call (*fptr) … Linker Gadgets (L-Gadgets) Execution Gadget (E-Gadgets) Collision Gadget (C-Gadgets) Over Approximation Legitimate Target loop Indirect call Direct call Ideal L-Gadget Useless L-Gadget
  • 17. Typed ROP (TROP) ngx_process_cycle.c:73:1: note: func rap_hash: 2858705e ngx_master_process_cycle ngx_process_cycle.c:315:21: note: fptr rap_hash: 2858705e cycle->modules[i]->exit_process(cycle) Building CG, CFG Finding Gadgets Detecting Candidate Paths 17
  • 18. Typed ROP (TROP) ngx_process_cycle.c:73:1: note: func rap_hash: 2858705e ngx_master_process_cycle ngx_process_cycle.c:315:21: note: fptr rap_hash: 2858705e cycle->modules[i]->exit_process(cycle) Building CG, CFG Finding Gadgets Constraint Solving Detecting Candidate Paths Exploits 18
  • 20. PoC Exploits (Nginx) 20 ... check 2858705e hash call (*exit_process) hash 2858705e ... ngx_worker_process_exit ngx_conf_flush_files() static void ngx_worker_process_exit(ngx_cycle_t *cycle) { ngx_uint_t i; ngx_connection_t *c; for (i = 0; cycle->modules[i]; i++) { if (cycle->modules[i]->exit_process) { cycle->modules[i]->exit_process(cycle); } } … }
  • 21. PoC Exploits (Nginx) 21 ... check 2858705e hash call (*exit_process) hash 2858705e ... ngx_worker_process_exit ngx_conf_flush_files() hash 2858705e call ngx_reap_children() ... ngx_master_process_cycle() C-Gadget void ngx_master_process_cycle(ngx_cycle_t * cycle) { … /* By setting this condition to true, the attacker can * reach to the next gadget which is ngx_reap_children() */ if (ngx_reap) { ngx_reap = 0; ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle, log, 0, "reap children"); live = ngx_reap_children(cycle); … … }
  • 22. PoC Exploits (Nginx) 22 ... check 2858705e hash call (*exit_process) hash 2858705e ... ngx_worker_process_exit ngx_conf_flush_files() hash 2858705e call ngx_reap_children() ... ngx_master_process_cycle() ... call ngx_spawn_process() ... ngx_reap_children() L-GadgetsC-Gadget static ngx_uint_t ngx_reap_children(ngx_cycle_t * cycle) { … for (i = 0; i < ngx_last_process; i++) { … if (ngx_processes[i].respawn && !ngx_processes[i].exiting && !ngx_terminate && !ngx_quit) { if (ngx_spawn_process(cycle, ngx_processes[i].proc, ngx_processes[i].data, ngx_processes[i].name, i) == NGX_INVALID_PID) { …
  • 23. PoC Exploits (Nginx) 23 ... check 2858705e hash call (*exit_process) hash 2858705e ... ngx_worker_process_exit ngx_conf_flush_files() hash 2858705e call ngx_reap_children() ... ngx_master_process_cycle() ... call ngx_spawn_process() ... ngx_reap_children() ... check 6e956407 hash call (*proc) ngx_spawn_process() L-GadgetsC-Gadget ngx_pid_t ngx_spawn_process(ngx_cycle_t *cycle, ngx_spawn_proc_pt proc, void *data, char *name, ngx_int_t respawn) { … switch (pid) { case -1: … case 0: ngx_pid = ngx_getpid(); proc(cycle, data); … }
  • 24. PoC Exploits (Nginx) 24 ... check 2858705e hash call (*exit_process) hash 2858705e ... ngx_worker_process_exit ngx_conf_flush_files() hash 2858705e call ngx_reap_children() ... ngx_master_process_cycle() ... call ngx_spawn_process() ... ngx_reap_children() ... check 6e956407 hash call (*proc) ngx_spawn_process() hash 6e956407 ... call execve() ngx_execute_proc() E-Gadget L-GadgetsC-Gadget static void ngx_execute_proc(ngx_cycle_t *cycle, void *data) { ngx_exec_ctx_t * ctx = data; if (execve(ctx->path, ctx->argv, ctx->envp) == -1) { ngx_log_error(NGX_LOG_ALERT, cycle -> log, ngx_errno, "execve() failed while executing %s"%s"", ctx -> name, ctx -> path); } exit(1); }
  • 25. ● Type Collisions ● Gadget Distribution ● Libc ● Type Checking vs. Points-to Analysis ● Type Diversification ● Practical Challenges Evaluation 25
  • 30. Type Checking vs. Points-to Analysis 30
  • 31. Type Diversification 31 void (*fptr)(int) void valid_target2(int) void invalid_target1(int) void invalid_target2(int) void valid_target1(int)
  • 32. ● Complicates separate compilation Type Diversification 32 void (*fptr)(int) void valid_target2(int) void invalid_target1(int_1) void invalid_target2(int_1) void valid_target1(int)
  • 33. ● Mismatch Types ○ void * can point to any pointer (e.g., int *) ● Support for Assembly Code Practical Challenges 33
  • 34. Conclusion ● Evaluated RTC from security and practicality perspectives ● Type collisions between function pointers and E-Gadgets are rare ● TROP showed collisions with other functions in a nested fashion can be exploited ● Gadgets for mounting TROP are abundant in real-world applications ● RTC is a practical defense but not sufficient to prevent control flow hijacking 34