Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 1.22 KB

README.md

File metadata and controls

33 lines (21 loc) · 1.22 KB

Patch ChromeDriver

patch-cd patches chromedriver binary to well known DOM injections that leak the browser is under scripted control.

It does so by loading chromedriver binary into memory, modifying some identifiers in place respecting binary size, and fexecve'ing directly from memory which doesn't require filesystem write permission of any kind.

For more information on relevant patches:

For patching and execing directly from memory:

Development

memfd_create and fexecve syscalls are only available on Linux, so full development environment requires a linux system (see bellow). But to easy development on other operating systems, the same functionality was implemented using a named temporal file and execve syscall.

Building for linux with Docker

To compile for Linux on MacOS:

docker run --rm --user "$(id -u)":"$(id -g)" -v "$PWD":/usr/src/myapp -w /usr/src/myapp rust:1.53.0 cargo build --release