Lucene search
+L

Google Chrome < M73 - FileSystemOperationRunner Use-After-Free

🗓️ 19 Mar 2019 00:00:00Reported by Google Security ResearchType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 116 Views

Google Chrome M73 FileSystemOperationRunner Use-After-Free vulnerability in BeginOperation causes use-after-free in browser process due to wrap-around of OperationID. Malformed blob or FileWriter api access needed to trigger. Attached PoCs for reproducing

Related
Code
ReporterTitlePublishedViews
Family
zdt
zdt
Google Chrome < M73 - FileSystemOperationRunner Use-After-Free Exploit
19 Mar 201900:00
–zdt
archlinux
ArchLinux
[ASA-201903-8] chromium: multiple issues
13 Mar 201900:00
–archlinux
bdu_fstec
BDU FSTEC
Blink Web Page Display Mechanism
27 Feb 202000:00
–bdu_fstec
circl
Circl
CVE-2019-5788
19 Mar 201900:00
–circl
cnvd
CNVD
Google Chrome memory misreference vulnerability (CNVD-2019-23319)
13 Mar 201900:00
–cnvd
checkpoint_advisories
Check Point Advisories
Google Chrome Use After Free Denial Of Service (CVE-2019-5788; CVE-2019-5789)
29 Apr 201900:00
–checkpoint_advisories
cve
CVE
CVE-2019-5788
23 May 201919:11
–cve
cvelist
Cvelist
CVE-2019-5788
23 May 201919:11
–cvelist
debian
Debian
[SECURITY] [DSA 4421-1] chromium security update
31 Mar 201919:40
–debian
debiancve
Debian CVE
CVE-2019-5788
23 May 201919:11
–debiancve
Rows per page
There's a comment in FileSystemOperationRunner::BeginOperation

OperationID FileSystemOperationRunner::BeginOperation(
    std::unique_ptr<FileSystemOperation> operation) {
  OperationID id = next_operation_id_++;

  // TODO(https://crbug.com/864351): Diagnostic to determine whether OperationID
  // wrap-around is occurring in the wild.
  DCHECK(operations_.find(id) == operations_.end());

  // ! If id already in operations_, this will free operation
  operations_.emplace(id, std::move(operation));
  return id;
}

The id is an int, and it can wrap, and if it does this will cause a use-after-free in the browser process, since the normal usage of BeginOperation is the following:

OperationID FileSystemOperationRunner::Truncate(const FileSystemURL& url,
                                                int64_t length,
                                                StatusCallback callback) {
  base::File::Error error = base::File::FILE_OK;
  std::unique_ptr<FileSystemOperation> operation = base::WrapUnique(
      file_system_context_->CreateFileSystemOperation(url, &error));
  // ! take a raw pointer to the contents of the unique_ptr
  FileSystemOperation* operation_raw = operation.get();
  // ! call BeginOperation passing the move'd unique_ptr, freeing operation
  OperationID id = BeginOperation(std::move(operation));
  base::AutoReset<bool> beginning(&is_beginning_operation_, true);
  if (!operation_raw) {
    DidFinish(id, std::move(callback), error);
    return id;
  }
  PrepareForWrite(id, url);
  // ! use the raw free'd pointer here.
  operation_raw->Truncate(url, length,
                          base::BindOnce(&FileSystemOperationRunner::DidFinish,
                                         weak_ptr_, id, std::move(callback)));
  return id;
}

I think that to trigger this, you'd need either a malformed blob in the blob registry, or access to the FileWriter api, so at present this would require a compromised renderer.

I've attached two PoCs that should trigger this issue; it looks like the runtime for either approach from javascript should take ~2 days on my machine. (I'd suggest patching the OperationId typedef to short to reproduce, unless you are extremely patient).

$ python ./copy_mojo_js_bindings.py /path/to/chrome/.../out/Asan/gen
$ python -m SimpleHTTPServer&
$ /ssd/chrome_trunk/src/out/Asan/chrome --enable-blink-features=MojoJS --user-data-dir=/tmp/aa 'http://localhost:8000/id_overflow_no_filewriter.html'


Proof of Concept:
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/46571.zip

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

19 Mar 2019 00:00Current
7.1High risk
Vulners AI Score7.1
CVSS 3.18.8
CVSS 29.3
EPSS0.09088
116