Semmle · Report #697055
Worker container escape lead to arbitrary file reading in host machine [again]
Validstatus
criticalseverity
$2,000bounty
178upvotes
21 Oct 2019disclosed
How it was found
Summary:
After a successful build, LGTM allow user to view the file list.
By default, only source code files and build config files are reserved (lgtm.yml and .lgtm.yml).
If there are both files in folder, LGTM will process lgtm.yml file and skip .lgtm.yml, but it still keeps both of files in directory.
By making symlink to .lgtm.yml file, after successful build, it will point to HOST MACHINE file!
Steps To Reproduce:
- Create a simple project which LGTM can build successful. In this report, I use this project (https://github.com/testanull/test11)
- Create file:
lgtm.ymlwith a valid config content, for example:
extraction:
java:
index:
build_command:
- ./custom-build
- Make a symlink point to a HOST MACHINE file/directory with name:
.lgtm.yml - After successful build,
.lgtm.ymlfile will contain the host machine file content!
PoC of reading /etc/passwd is attached below
Impact
Give attacker ability to explore the host machine, expose more sensitive informations from it.