module
Safari Webkit Proxy Object Type Confusion
Disclosed | Created |
---|---|
03/15/2018 | 06/02/2019 |
Disclosed
03/15/2018
Created
06/02/2019
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.
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.
Authors
saeloniklasbIan Beersiguza
Platform
Apple_iOS
Architectures
aarch64
References
Module Options
To display the available options, load the module within the Metasploit console and run the commands ‘show options’ or ‘show advanced’:
msf > use exploit/apple_ios/browser/webkit_createthis msf /(s) > show actions ...actions... msf /(s) > set ACTION < action-name > msf /(s) > show options ...show and set options... msf /(s) > run

NEW
Explore Exposure Command
Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.