From 3569b0a9c48f8b94ebaef2f8b607c52fdb8e570a Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Thu, 31 Oct 2024 01:53:52 -0300 Subject: [PATCH] fix: incorrect validation for networking permission on Deno process (#33786) --- .changeset/nervous-rivers-fry.md | 6 ++++++ .../src/server/runtime/deno/AppsEngineDenoRuntime.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/nervous-rivers-fry.md diff --git a/.changeset/nervous-rivers-fry.md b/.changeset/nervous-rivers-fry.md new file mode 100644 index 000000000000..278259c53a86 --- /dev/null +++ b/.changeset/nervous-rivers-fry.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/apps-engine': patch +'@rocket.chat/meteor': patch +--- + +Fixed an issue that would grant network permission to app's processes in wrong cases diff --git a/packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts b/packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts index 580775454a46..4ddfc5d542e6 100644 --- a/packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts +++ b/packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts @@ -132,7 +132,7 @@ export class DenoRuntimeSubprocessController extends EventEmitter { // If the app doesn't request any permissions, it gets the default set of permissions, which includes "networking" // If the app requests specific permissions, we need to check whether it requests "networking" or not - if (!this.appPackage.info.permissions || this.appPackage.info.permissions.findIndex((p) => p.name === 'networking.default')) { + if (!this.appPackage.info.permissions || this.appPackage.info.permissions.findIndex((p) => p.name === 'networking.default') !== -1) { hasNetworkingPermission = true; }