Skip to content

Commit

Permalink
Prevent command injection via "Run external program" function
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Jul 20, 2019
1 parent 7f3291c commit a610c85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,11 @@ void Application::runExternalProgram(const BitTorrent::TorrentHandle *torrent) c

::LocalFree(args);
#else
QProcess::startDetached(QLatin1String("/bin/sh"), {QLatin1String("-c"), program});
// Cannot give users shell environment by default, as doing so could
// enable command injection via torrent name and other arguments
// (especially when some automated download mechanism has been setup).
// See: https://github.com/qbittorrent/qBittorrent/issues/10925
QProcess::startDetached(program);
#endif
}

Expand Down

0 comments on commit a610c85

Please sign in to comment.