CVE-2022-3315 is a vulnerability in Blink, the engine responsible for rendering web content in Google Chrome. This type confusion vulnerability could potentially allow an attacker to remotely execute code on a user's machine by enticing them to visit a maliciously crafted web page. Google Chrome versions prior to 106..5249.62 are affected by this vulnerability, which has been categorized as having a low severity according to Chromium's security team. This blog post will explore the details of the vulnerability, code snippets showcasing the vulnerability, and how it could be exploited using a crafted HTML page.

Discovering the Vulnerability

The root cause of the vulnerability lies in how Blink processes certain DOM (Document Object Model) API calls. The affected portion of the codebase was found to have a type confusion flaw, a situation where a programming language's type system is subverted, allowing the manipulation of objects in ways that were not intended by the developer. This can result in heap corruption and potentially lead to arbitrary code execution by an attacker.

Reference to original advisory

For a detailed explanation of this vulnerability and its impact on affected browsers, please refer to Chromium's original advisory, publicly available here.

Code Snippet Demonstrating the Vulnerability

As mentioned earlier, this vulnerability occurs due to a type confusion issue in Blink's processing of DOM API calls. Let's take a look at an example code snippet that demonstrates the type confusion:

// Create a new HTML template element
const template = document.createElement("template");

// Insert an <embed> tag into the template content
template.innerHTML = "<embed>";

// Access template content and modify the <embed> tag
const embedElement = template.content.querySelector("embed");
embedElement.setProperty("property_name", "property_value");

// Insert template content into the DOM

In this code snippet, we create a new template element and insert an embed tag within its content. We then attempt to access and modify the created embed element by calling the setProperty method on it. Finally, we add the modified embed element into the DOM. The issue occurs due to a type confusion when calling the setProperty method, which, under certain circumstances, results in heap corruption.

Exploiting the Vulnerability

An attacker could exploit this vulnerability by luring a user into visiting a crafted web page containing code similar to the one showcased in the above snippet. Here's how an example attack scenario could play out:

1. The attacker creates a malicious web page containing a specially crafted set of DOM API calls designed to trigger the discussed vulnerability.
2. The attacker entices their target into visiting the malicious web page. This could be done via a variety of social engineering techniques such as phishing emails, instant messaging, and forum postings.

The targeted user visits the malicious web page using a vulnerable version of Google Chrome.

4. By loading the malicious web page, the type confusion vulnerability is triggered, resulting in heap corruption.
5. If the attacker is successful in exploiting the heap corruption, they may potentially be able to execute arbitrary code on the targeted user's machine.

Mitigation Steps and Patch Details

Google has released a patch for this vulnerability in the version 106..5249.62 of Chrome. To mitigate the risk of exploitation, users are strongly encouraged to update their browser to the latest version as soon as possible. You can find instructions on how to update Google Chrome here.


CVE-2022-3315 is a type confusion vulnerability in Blink, the rendering engine used by Google Chrome, that could potentially allow an attacker to exploit heap corruption via a crafted HTML page. Although classified as having low severity by Chromium's security team, this vulnerability highlights the importance of staying vigilant and keeping browsers up-to-date to protect against potential threats.


Published on: 11/01/2022 20:15:00 UTC
Last modified on: 12/08/2022 21:54:00 UTC