Google Chrome < M73 - Double-Destruction Race in StoragePartitionService
🗓️ 19 Mar 2019 00:00:00Reported by Google Security ResearchType
exploitdb🔗 www.exploit-db.com👁 50 Views
| Reporter | Title | Published | Views | Family All 54 |
|---|---|---|---|---|
| [ASA-201903-8] chromium: multiple issues | 13 Mar 201900:00 | – | archlinux | |
| The vulnerability of Google Chrome’s web storage mechanism, which allows a hacker to circumvent existing security restrictions | 4 Jan 202200:00 | – | bdu_fstec | |
| CVE-2019-5797 | 19 Mar 201900:00 | – | circl | |
| Google Chrome Race Condition Denial Of Service (CVE-2019-5796; CVE-2019-5797) | 29 Apr 201900:00 | – | checkpoint_advisories | |
| CVE-2019-5797 | 29 Sep 202201:45 | – | cve | |
| CVE-2019-5797 | 29 Sep 202201:45 | – | cvelist | |
| [SECURITY] [DSA 4421-1] chromium security update | 31 Mar 201919:40 | – | debian | |
| CVE-2019-5797 | 29 Sep 202201:45 | – | debiancve | |
| Debian DSA-4421-1 : chromium - security update | 1 Apr 201900:00 | – | nessus | |
| Fedora 30 : chromium (2019-05a780936d) | 2 May 201900:00 | – | nessus |
10
There's a race condition in the destruction of the BindingState for bindings to the StoragePartitionService.
It looks like the root cause of the issue is that since we can get two concurrent calls to callbacks returned from mojo::BindingSet::GetBadMessageCallback() from the same BindingSet, which results in a data race destroying the same BindingState.
One case where this can be called is in a synchronous context when validating a received message, or when tearing down the connection. The other context is the callback passed to OpenSessionStorage here
https://cs.chromium.org/chromium/src/content/browser/storage_partition_impl.cc?rcl=59d4c1b34bfde4fbc31f7a40ab7d0e7df58ffd67&l=912
This is then posted to the mojo task runner thread here:
https://cs.chromium.org/chromium/src/content/browser/dom_storage/dom_storage_context_wrapper.cc?rcl=59d4c1b34bfde4fbc31f7a40ab7d0e7df58ffd67&l=433
And can be called on this thread directly here:
https://cs.chromium.org/chromium/src/content/browser/dom_storage/session_storage_context_mojo.cc?rcl=59d4c1b34bfde4fbc31f7a40ab7d0e7df58ffd67&l=140
Since this is a tight race, the repro is not terribly reliable. Opening multiple tabs at once will increase your chances of reproducing to the point where the issue triggers around 50% of the time (on my machine, mileage will vary depending on system load etc...). I found the most convenient way to reproduce was to use a ThreadSanitizer build, but since the most common result is a double-free, this will often crash a normal release build when the freelist corruption is detected.
$ python ./copy_mojo_js_bindings.py /path/to/chrome/.../out/Asan/gen
$ python -m SimpleHTTPServer&
$ /ssd/chrome_trunk/src/out/Tsan/chrome --enable-blink-features=MojoJS
--no-sandbox --user-data-dir=/tmp/aa 'http://localhost:8000/index.html' 'http://localhost:8000/index.html' 'http://localhost:8000/index.html' 'http://localhost:8000/index.html' 'http://localhost:8000/index.html' 'http://localhost:8000/index.html' 'http://localhost:8000/index.html' 'http://localhost:8000/index.html'
Proof of Concept:
https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/46565.zipData
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.17.5
EPSS0.02828
SSVC