Vulnerabilities > CVE-2017-13861 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in Apple Iphone OS
Attack vector
LOCAL Attack complexity
LOW Privileges required
NONE Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
HIGH Summary
An issue was discovered in certain Apple products. iOS before 11.2 is affected. tvOS before 11.2 is affected. watchOS before 4.2 is affected. The issue involves the "IOSurface" component. It allows attackers to execute arbitrary code in a privileged context or cause a denial of service (memory corruption) via a crafted app.
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Buffer Overflow via Environment Variables This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
- Overflow Buffers Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
- Client-side Injection-induced Buffer Overflow This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
- Filter Failure through Buffer Overflow In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
- MIME Conversion An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.
Exploit-Db
description | iOS/macOS - Kernel Double Free due to IOSurfaceRootUserClient not Respecting MIG Ownership Rules. CVE-2017-13861. Dos exploit for Multiple platform |
file | exploits/multiple/dos/43320.txt |
id | EDB-ID:43320 |
last seen | 2017-12-11 |
modified | 2017-12-11 |
platform | multiple |
port | |
published | 2017-12-11 |
reporter | Exploit-DB |
source | https://www.exploit-db.com/download/43320/ |
title | iOS/macOS - Kernel Double Free due to IOSurfaceRootUserClient not Respecting MIG Ownership Rules |
type | dos |
Metasploit
description | This module exploits a type confusion bug in the Javascript Proxy object in WebKit. The DFG JIT does not take into account that, through the use of a Proxy, it is possible to run arbitrary JS code during the execution of a CreateThis operation. This makes it possible to change the structure of e.g. an argument without causing a bailout, leading to a type confusion (CVE-2018-4233). The type confusion leads to the ability to allocate fake Javascript objects, as well as the ability to find the address in memory of a Javascript object. This allows us to construct a fake JSCell object that can be used to read and write arbitrary memory from Javascript. The module then uses a ROP chain to write the first stage shellcode into executable memory within the Safari process and kick off its execution. The first stage maps the second stage macho (containing CVE-2017-13861) into executable memory, and jumps to its entrypoint. The CVE-2017-13861 async_wake exploit leads to a kernel task port (TFP0) that can read and write arbitrary kernel memory. The processes credential and sandbox structure in the kernel is overwritten and the meterpreter payloads code signature hash is added to the kernels trust cache, allowing Safari to load and execute the (self-signed) meterpreter payload. |
id | MSF:EXPLOIT/APPLE_IOS/BROWSER/WEBKIT_CREATETHIS |
last seen | 2020-06-13 |
modified | 2019-07-10 |
published | 2019-02-24 |
references |
|
reporter | Rapid7 |
source | https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/apple_ios/browser/webkit_createthis.rb |
title | Safari Webkit Proxy Object Type Confusion |
Nessus
NASL family | Misc. |
NASL id | APPLETV_11_2.NASL |
description | According to its banner, the version of Apple TV on the remote device is prior to 11.2. It is, therefore, affected by multiple vulnerabilities as described in the HT208327 security advisory. Note that only 4th and 5th generation models are affected by these vulnerabilities. |
last seen | 2020-06-01 |
modified | 2020-06-02 |
plugin id | 105612 |
published | 2018-01-05 |
reporter | This script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof. |
source | https://www.tenable.com/plugins/nessus/105612 |
title | Apple TV < 11.2 Multiple Vulnerabilities |
Packetstorm
data source | https://packetstormsecurity.com/files/download/153148/webkit_createthis.rb.txt |
id | PACKETSTORM:153148 |
last seen | 2019-06-02 |
published | 2019-06-02 |
reporter | saelo |
source | https://packetstormsecurity.com/files/153148/Safari-Webkit-Proxy-Object-Type-Confusion.html |
title | Safari Webkit Proxy Object Type Confusion |
Seebug
bulletinFamily | exploit |
description | I have previously detailed the lifetime management paradigms in MIG in the writeups for: CVE-2016-7612 [https://bugs.chromium.org/p/project-zero/issues/detail?id=926] and CVE-2016-7633 [https://bugs.chromium.org/p/project-zero/issues/detail?id=954] If a MIG method returns KERN_SUCCESS it means that the method took ownership of `*all*` the arguments passed to it. If a MIG method returns an error code, then it took ownership of `*none*` of the arguments passed to it. If an IOKit userclient external method takes an async wake mach port argument then the lifetime of the reference on that mach port passed to the external method will be managed by MIG semantics. If the external method returns an error then MIG will assume that the reference was not consumed by the external method and as such the MIG generated coode will drop a reference on the port. IOSurfaceRootUserClient external method 17 (s_set_surface_notify) will drop a reference on the wake_port (via IOUserClient::releaseAsyncReference64) then return an error code if the client has previously registered a port with the same callback function. The external method's error return value propagates via the return value of is_io_connect_async_method back to the MIG generated code which will drop a futher reference on the wake_port when only one was taken. This bug is reachable from the iOS app sandbox as demonstrated by this PoC. Tested on iOS 11.0.3 (11A432) on iPhone 6s (MKQL2CN/A) Tested on MacOS 10.13 (17A365) on MacBookAir5,2 [iosurface_uaf_ios.zip](https://bugs.chromium.org/p/project-zero/issues/attachment?aid=309555) [async_wake_ios.zip ](https://bugs.chromium.org/p/project-zero/issues/attachment?aid=315907) |
id | SSV:96991 |
last seen | 2017-12-25 |
modified | 2017-12-15 |
published | 2017-12-15 |
reporter | Root |
title | iOS/MacOS kernel double free due to IOSurfaceRootUserClient not respecting MIG ownership rules(CVE-2017-13861) |
References
- http://packetstormsecurity.com/files/153148/Safari-Webkit-Proxy-Object-Type-Confusion.html
- http://packetstormsecurity.com/files/153148/Safari-Webkit-Proxy-Object-Type-Confusion.html
- http://www.securityfocus.com/bid/102134
- http://www.securityfocus.com/bid/102134
- http://www.securitytracker.com/id/1039952
- http://www.securitytracker.com/id/1039952
- http://www.securitytracker.com/id/1039953
- http://www.securitytracker.com/id/1039953
- https://support.apple.com/HT208325
- https://support.apple.com/HT208325
- https://support.apple.com/HT208327
- https://support.apple.com/HT208327
- https://support.apple.com/HT208334
- https://support.apple.com/HT208334
- https://www.exploit-db.com/exploits/43320/
- https://www.exploit-db.com/exploits/43320/