Rapid7 Vulnerability & Exploit Database

Docker Container Escape Via runC Overwrite

Back to Search

Docker Container Escape Via runC Overwrite

Disclosed
01/01/2019
Created
07/01/2021

Description

This module leverages a flaw in `runc` to escape a Docker container and get command execution on the host as root. This vulnerability is identified as CVE-2019-5736. It overwrites the `runc` binary with the payload and wait for someone to use `docker exec` to get into the container. This will trigger the payload execution. Note that executing this exploit carries important risks regarding the Docker installation integrity on the target and inside the container ('Side Effects' section in the documentation).

Author(s)

  • Adam Iwaniuk
  • Borys Popławski
  • Nick Frichette
  • Christophe De La Fuente
  • Spencer McIntyre

Platform

Linux,Unix

Architectures

cmd, x86, x64

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/linux/local/docker_runc_escape
msf exploit(docker_runc_escape) > show targets
    ...targets...
msf exploit(docker_runc_escape) > set TARGET < target-id >
msf exploit(docker_runc_escape) > show options
    ...show and set options...
msf exploit(docker_runc_escape) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;