Userland: Always enter jail mode in Browser and Assistant

These programs are capable of running other programs, so we should
restrict them from potentially running SUID programs, which was never a
functionality we supported for those programs anyway.
This commit is contained in:
Liav A. authored and Tim Schumacher committed 2024-07-21 11:44:23 +02:00
1 parent dd59fe35c7
commit 816f2efb4e
2 files changed
+4

No files matched your search

+2
View File
@@ -148,6 +148,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio recvfd sendfd rpath cpath unix proc exec thread map_fixed"));
TRY(Core::System::enter_jail_mode());
Core::LockFile lockfile("/tmp/lock/assistant.lock");
if (!lockfile.is_held()) {
+2
View File
@@ -180,6 +180,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/bin/Browser", "x"));
TRY(Core::System::unveil(nullptr, nullptr));
TRY(Core::System::enter_jail_mode());
WebView::ChromeProcess chrome_process;
if (TRY(chrome_process.connect(specified_urls, new_window)) == WebView::ChromeProcess::ProcessDisposition::ExitProcess) {
outln("Opening in existing process");