Google Chrome Vulnerability Worth for $6K: Use After Free (CVE-2021-30573)
A use-after-free flaw was found in Google Chrome when a long warning message was written in the options part of an HTML select element. An attacker could potentially exploit this to cause a crash or possibly execute arbitrary code.
Published on securityforeveryone.com
As the S4E team, we are always interested in new vulnerabilities and challenging bounty programs. Although we focus on customer feedback on our products in the early stage of our startup, we conduct various vulnerability studies whenever we can.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This write-up covers a use after free (UAF) vulnerability that the S4E team found in Google Chrome and reported to Google. The affected component is the HTML select element, specifically the options part of it. A select element normally holds a list of option children that the browser renders as a dropdown; the options can carry text labels, and the browser has to lay out and paint that text. The team triggered a crash by writing a long warning message into the options part of the select element.
The vulnerability is tracked as CVE-2021-30573. Google awarded the team 6000 USD for the report. The team published a proof of concept in a GitHub repository linked from the write-up.
Setup
The team did not describe any accounts, roles or special tooling beyond a debugger and AddressSanitizer output. The environment in which the vulnerability was detected is given as:
| Item | Value |
|---|---|
| Chrome version | 91.0.4472.77, stable, Official Build, 64-bit |
| Operating systems | Kali GNU/Linux version 2020.1, Ubuntu version 20.04.2 LTS, Ubuntu version 20.04.1 LTS |
The report gives only the Chrome version and operating systems; it does not describe the page or how the content was entered. No authentication or privileged position is mentioned.
Finding it
The discovery was accidental. During product development the team noticed that the Chrome process and the operating system crashed when a long warning message was written into the options part of an HTML select element. That is the kind of crash that suggests memory corruption rather than a rendering glitch, so they debugged the browser.
They reproduced the crash by typing a specific number and some special characters, including some HTML tags, into the options part of the select element. When triggered, the debug build logged the following AddressSanitizer report:
==40998==ERROR: AddressSanitizer: heap-use-after-free on address 0x61600000dce4 at pc 0x55e40c87ca32 bp 0x7ffdb5e46fd0 sp 0x7ffdb5e46fc8
The important part is the classification: heap-use-after-free. AddressSanitizer is telling us that a heap allocation was freed and then read or written through a stale pointer. The address, program counter, base pointer and stack pointer values are specific to that run and are not meaningful beyond identifying the crash site.
The exact input that produced this is not reproduced in the write-up; the team points to the PoC in their GitHub repository instead.
Exploitation
The write-up does not give a step-by-step exploitation sequence with requests or payloads. What it does give is the reproduction recipe and the crash evidence.
Step 1: build a page with a select element
Create an HTML page containing a select element and populate its options part with content. The write-up does not include the page source.
Step 2: write a long warning message into the options
Enter a specific number together with special characters, including HTML tags, into the options part of the select element. The team triggered it by typing a specific number and some special characters, including some HTML tags, into the options part.
Step 3: observe the crash
On the affected build the Chrome process and the operating system crashed. Running under AddressSanitizer produced the heap-use-after-free report shown above, which confirmed the class of the bug.
Step 4: report to Google
The team reported the issue to the Google Security team. They note in passing that they were impressed by Google's bug and vulnerability management system. Google awarded 6000 USD for the finding.
Root cause
The write-up does not analyse the underlying source code, so the precise faulty object and the exact lifetime mistake are not stated. AddressSanitizer flagged a heap use after free, but the report does not identify the freed object. The trigger involves a long warning message containing a specific number, special characters and HTML tags inside the options of a select element.
Why the existing defences did not stop it is not discussed in the report. The team debugged the browser and saw the AddressSanitizer report when they triggered the crash.
Impact
It reports a crash of the browser process and, in the team's environment, of the operating system, and it classifies the issue as a use after free. Memory corruption of this class is the kind of bug that can, depending on how the freed object is reused, lead to code execution, but the report does not claim that and does not demonstrate it. The report links to the CVE entry, the PoC repository, the Chrome stable channel update, a Red Hat Bugzilla entry and a CIS advisory.
Fix
It links to the Chrome stable channel update from July 2021, the Red Hat Bugzilla entry and the CIS advisory. The practical guidance the team gives to users is:
- Regularly install the latest stable update provided by Google.
- Run all software as a non-privileged user, without administrative privileges, to mitigate the effects of a successful attack.
- As far as possible, do not visit untrusted websites and do not follow links from unknown or untrusted sources; do not click links, especially in emails or attachments, from untrusted sources.
- Apply the principle of least privilege to any IT infrastructure you use.
Variants to test
The report gives one trigger shape: a long warning message containing a specific number, special characters and HTML tags inside the options of a select element. The report gives one trigger shape; the variations below are not from it.
- Vary the length of the option text while keeping the markup. A positive result is a crash or an AddressSanitizer
heap-use-after-freereport in the option rendering path. - Vary the markup embedded in the option content, for example different tag combinations around the text. A positive result is the same sanitizer classification at a related call site.
- Vary the numeric value mixed into the message. A positive result is a crash that only occurs for particular values, which would suggest a parsing or conversion step in the same path.
- Run the same page under a debug build with AddressSanitizer rather than a release build. A positive result is a sanitizer report where the release build merely crashes or misbehaves, which confirms memory corruption rather than a rendering issue.
- Reproduce on the listed operating systems (Kali GNU/Linux 2020.1, Ubuntu 20.04.2 LTS, Ubuntu 20.04.1 LTS) and on other platforms. A positive result is consistent reproduction across them, which would indicate the bug is in shared browser code rather than a platform-specific path.
The PoC itself is in the team's GitHub repository, linked from the write-up, if you want the exact input rather than reconstructing it.
What happened, in plain words
The S4E team found a bug in Google Chrome, the web browser. The bug lived in a small, ordinary part of a web page: a dropdown list, the kind where you click and a list of choices opens. In the technical language of web pages, that dropdown is called a select element, and each choice inside it is called an option.
When the team wrote a long warning message, containing a number, some special characters and some HTML tags, into the choices of that dropdown, Chrome crashed. Not just the page: the browser process crashed, and on their machines the operating system crashed too. A crash like that is a strong hint that something went wrong deep inside the browser's memory handling, so they attached a debugging tool and looked at the log.
The log named the problem: a use after free. That is a memory corruption bug, and it was tracked as CVE-2021-30573. Google paid the team 6000 USD for the report, and the team published a proof of concept (a small program that reproduces the bug) in a GitHub repository.
This article walks through what they did, in the same order they did it, and explains every term along the way. You only need to know how to use a browser and a computer to follow it.
Context
The product and the feature
Google Chrome is a web browser: the program you use to open websites. A website is written in HTML, a language made of tags such as <select> and <option> that tell the browser what to display.
A select element is the HTML way of writing a dropdown list. It normally contains a list of option children, and the browser draws them as a menu the user can open. Each option can carry a text label, and the browser has to work out where that text goes on screen and then draw it. That work is called layout and painting.
The team triggered a crash by writing a long warning message into the options part of the select element. "Memory corruption" means the program used a piece of its own memory in a way it was not supposed to, which can make it crash or, in the worst case, run someone else's code.
The identifier and the reward
The vulnerability is tracked as CVE-2021-30573. A CVE is a public catalogue number for a known security flaw, so that everyone, from vendors to defenders, can refer to the same bug by the same name. Google awarded the team 6000 USD for the report. The team published a proof of concept in a GitHub repository linked from the write-up.
Setup
What you need
The team did not describe any accounts, roles or special tooling beyond a debugger and AddressSanitizer output. A debugger is a tool that lets you pause a running program and inspect what it is doing. AddressSanitizer is a tool built into a special debug version of a program that watches memory use and shouts when something is wrong.
The environment in which the vulnerability was detected is given as:
| Item | Value |
|---|---|
| Chrome version | 91.0.4472.77, stable, Official Build, 64-bit |
| Operating systems | Kali GNU/Linux version 2020.1, Ubuntu version 20.04.2 LTS, Ubuntu version 20.04.1 LTS |
"Stable" means the normal release channel that ordinary users get, as opposed to a test build. "64-bit" describes the kind of processor instructions the build targets. Kali and Ubuntu are two Linux distributions, that is, two packaged versions of the Linux operating system.
The report gives only the Chrome version and operating systems; it does not describe the page or how the content was entered. No authentication or privileged position is mentioned: you do not need to log in anywhere or be an administrator.
Finding it
The accidental discovery
The discovery was accidental. During product development the team noticed that the Chrome process and the operating system crashed when a long warning message was written into the options part of an HTML select element. That is the kind of crash that suggests memory corruption rather than a rendering glitch, so they debugged the browser.
Why does a crash suggest memory corruption? A rendering glitch is a visual mistake: text in the wrong place, a missing image. A crash of the whole browser process suggests something went wrong deep inside the browser's memory handling. That is why the team reached for a debugger instead of just taking a screenshot.
Reproducing the crash
They reproduced the crash by typing a specific number and some special characters, including some HTML tags, into the options part of the select element. When triggered, the debug build logged the following AddressSanitizer report:
==40998==ERROR: AddressSanitizer: heap-use-after-free on address 0x61600000dce4 at pc 0x55e40c87ca32 bp 0x7ffdb5e46fd0 sp 0x7ffdb5e46fc8
Line by line, in plain words:
==40998==is the process identifier of the program that produced the message, so you can tell which run it came from.ERROR: AddressSanitizer:says the memory-watching tool, AddressSanitizer, is reporting a problem.heap-use-after-freeis the classification of the problem. The heap is the area of memory a program uses for objects it creates while running. "Use after free" means the program gave a piece of that memory back (freed it) and then read or wrote it again through a pointer that still referred to it. A pointer is simply a memory address, like a house number.on address 0x61600000dce4is the memory address where the bad access happened.at pc 0x55e40c87ca32is the program counter, the address of the instruction that was executing at the time.bp 0x7ffdb5e46fd0 sp 0x7ffdb5e46fc8are the base pointer and stack pointer, two bookkeeping values that describe where the program was in its call stack.
The important part is the classification: heap-use-after-free. AddressSanitizer is telling us that a heap allocation was freed and then read or written through a stale pointer. The address, program counter, base pointer and stack pointer values are specific to that run and are not meaningful beyond identifying the crash site.
The exact input that produced this is not reproduced in the write-up; the team points to the PoC in their GitHub repository instead.
Exploitation
What the write-up does and does not give
The write-up does not give a step-by-step exploitation sequence with requests or payloads. What it does give is the reproduction recipe and the crash evidence. "Exploitation" here means turning a bug into a working attack; the team stopped at proving the bug exists, which is what a bug bounty report needs.
Step 1: build a page with a select element
Create an HTML page containing a select element and populate its options part with content. The write-up does not include the page source.
Why this step? The bug lives in the code that handles the options of a dropdown, so you first need a page that has one. Without a select element there is nothing for the buggy code to run on.
Step 2: write a long warning message into the options
Enter a specific number together with special characters, including HTML tags, into the options part of the select element. The team triggered it by typing a specific number and some special characters, including some HTML tags, into the options part.
Why this step? The browser has to lay out and paint the option text.
Step 3: observe the crash
On the affected build the Chrome process and the operating system crashed. Running under AddressSanitizer produced the heap-use-after-free report shown above, which confirmed the class of the bug.
Why this step? A crash alone tells you something is wrong but not what. The sanitizer report names the class of the problem, which is what makes the report useful to the vendor.
Step 4: report to Google
The team reported the issue to the Google Security team. They note in passing that they were impressed by Google's bug and vulnerability management system. Google awarded 6000 USD for the finding.
Why this step? A bug bounty programme is a scheme where a company pays researchers who report flaws responsibly, so the company can fix them before attackers use them. Reporting privately to the vendor is the responsible route.
Root cause
What the evidence shows
The write-up does not analyse the underlying source code, so the precise faulty object and the exact lifetime mistake are not stated. AddressSanitizer flagged a heap use after free, but the report does not identify the freed object. The trigger involves a long warning message containing a specific number, special characters and HTML tags inside the options of a select element.
An everyday comparison: imagine you return a library book, the librarian puts it back on the shelf for someone else, and you keep reading from your notes that refer to that copy. The book is no longer yours, but you still act as if it is. In memory terms, the freed object may already belong to something else, and reading or writing it can corrupt whatever now lives there.
Why the defences did not stop it
Why the existing defences did not stop it is not discussed in the report. The team debugged the browser and saw the AddressSanitizer report when they triggered the crash. A normal release build does not carry that instrumentation, because it would slow the browser down.
Impact
What the report claims
It reports a crash of the browser process and, in the team's environment, of the operating system, and it classifies the issue as a use after free.
Memory corruption of this class is the kind of bug that can, depending on how the freed object is reused, lead to code execution, but the report does not claim that and does not demonstrate it. "Code execution" means an attacker getting their own instructions to run on your machine, which is the worst outcome of a memory bug. The report links to the CVE entry, the PoC repository, the Chrome stable channel update, a Red Hat Bugzilla entry and a CIS advisory.
Fix
What the report says about the fix
It links to the Chrome stable channel update from July 2021, the Red Hat Bugzilla entry and the CIS advisory. Bugzilla is a public bug tracker, and CIS is a security organisation that publishes advisories, that is, short notices telling defenders what to patch.
Practical guidance for users
The practical guidance the team gives to users is:
- Regularly install the latest stable update provided by Google.
- Run all software as a non-privileged user, without administrative privileges, to mitigate the effects of a successful attack.
- As far as possible, do not visit untrusted websites and do not follow links from unknown or untrusted sources; do not click links, especially in emails or attachments, from untrusted sources.
- Apply the principle of least privilege to any IT infrastructure you use.
Why each one helps:
- Updates carry the fix. Until you install the stable update, your browser still has the bug.
- A non-privileged user cannot change system files or install software, so an attacker who gets code running as that user has less power. This is the idea of least privilege: give every account only the rights it actually needs.
- Most attacks arrive through a page or a link. Avoiding untrusted sources removes the delivery route.
- Least privilege applied to servers and networks limits how far an attacker can move after a first success.
Variants to test
Trying the same idea in different shapes
The report gives one trigger shape: a long warning message containing a specific number, special characters and HTML tags inside the options of a select element. The report gives one trigger shape; the variations below are not from it.
- Vary the length of the option text while keeping the markup. A positive result is a crash or an AddressSanitizer
heap-use-after-freereport in the option rendering path. - Vary the markup embedded in the option content, for example different tag combinations around the text. A positive result is the same sanitizer classification at a related call site.
- Vary the numeric value mixed into the message. A positive result is a crash that only occurs for particular values, which would suggest a parsing or conversion step in the same path.
- Run the same page under a debug build with AddressSanitizer rather than a release build. A positive result is a sanitizer report where the release build merely crashes or misbehaves, which confirms memory corruption rather than a rendering issue.
- Reproduce on the listed operating systems (Kali GNU/Linux 2020.1, Ubuntu 20.04.2 LTS, Ubuntu 20.04.1 LTS) and on other platforms. A positive result is consistent reproduction across them, which would indicate the bug is in shared browser code rather than a platform-specific path.
Why vary at all? A single trigger tells you a bug exists. Varying the input tells you how wide the bug is, which helps the vendor fix the whole class of problem rather than one symptom. The PoC itself is in the team's GitHub repository, linked from the write-up, if you want the exact input rather than reconstructing it.
Glossary
- AddressSanitizer: a tool built into debug builds of programs that watches memory use and reports problems such as use after free.
- Advisory: a short public notice from a security organisation telling people what is affected and what to patch.
- Base pointer (bp): a bookkeeping value that marks the start of the current function's area on the call stack.
- Bug bounty programme: a scheme where a company pays researchers who report security flaws privately so they can be fixed.
- Bugzilla: a public bug tracking system used by projects and vendors.
- Call stack: the list of functions a program is currently inside, one on top of another.
- Chrome: Google's web browser.
- Code execution: an attacker getting their own instructions to run on a machine.
- CVE: a public catalogue number for a known security vulnerability.
- Debug build: a version of a program compiled with extra checks and logging, used for investigation rather than daily use.
- Debugger: a tool that lets you pause a running program and inspect its state.
- Dropdown list: a user interface control that shows one choice and opens a list of choices when clicked; in HTML it is a
selectelement. - Heap: the area of memory a program uses for objects it creates while running.
- HTML: the language web pages are written in, made of tags such as
<select>and<option>. - HTML tag: a piece of markup such as
<option>that tells the browser what an element is. - Kali GNU/Linux: a Linux distribution aimed at security work.
- Layout and painting: the browser working out where text and elements go on screen and then drawing them.
- Least privilege: the principle of giving every account or program only the rights it actually needs.
- Linux distribution: a packaged version of the Linux operating system, such as Ubuntu or Kali.
- Memory corruption: a bug where a program uses its own memory in a way it was not supposed to, which can cause crashes or code execution.
- Non-privileged user: an account without administrative rights, so it cannot change system files or install software.
option: the HTML element for one choice inside a dropdown list.- Pointer: a memory address that refers to a location in memory, like a house number.
- Principle of least privilege: see least privilege.
- Program counter (pc): the address of the instruction the processor is currently executing.
- Proof of concept (PoC): a small program or input that reliably reproduces a bug.
- Release build: the normal version of a program shipped to users, without debug instrumentation.
select: the HTML element for a dropdown list.- Stable channel: the normal release channel of a browser that ordinary users receive.
- Stack pointer (sp): a bookkeeping value that marks the current position on the call stack.
- Use after free (UAF): a memory bug where a program frees an object and then reads or writes it again through a stale pointer.
- 64-bit: a description of the processor instruction set a build targets.