Skip to content

Commit

Permalink
Fix for CVE-2017-5226
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavNikolov committed Aug 20, 2023
1 parent fb8d946 commit 38f69b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/arena.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ async function spawnBotProcess(tmpdir: string, hash: string) {
"--ro-bind", dirname(dotnetBin), "/dotnet", // Mount the dotnet install directory
"--ro-bind", tmpdir, "/fight",
"--chdir", "/fight",

// Thanks to discord user Omsk for finding this!
// https://nvd.nist.gov/vuln/detail/CVE-2017-5226
// https://github.com/containers/bubblewrap/pull/560
"--new-session",

"--unshare-all", // This disables practically everything, including reading other pids, network, etc.
"--clearenv", // Do not leak any other env variable, not that they would help
"--", "/dotnet/dotnet", `${hash}.dll` // Actually start the damn bot!
Expand Down

0 comments on commit 38f69b5

Please sign in to comment.