From a09d7553fbfecd2ad1c32d6d40a3f85d95c4f589 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 13 Aug 2026 00:38:33 +0530 Subject: [PATCH] fix(sites): stop listFrameworks leaking runtime commands Response models filter nested Documents, not plain arrays. listFrameworks handed Config's raw rows straight to the response, so every key on them went out with it: each adapter's startCommand, plus the framework-level bundleCommand, envCommand and screenshotSleep. The console read that leaked start command and wrote it into sites as if the user had typed it. Wrap the rows in Documents so the declared models decide what ships. --- .../Platform/Modules/Sites/Http/Frameworks/XList.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php index e49ace4486..c0098dca3a 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php @@ -79,9 +79,19 @@ class XList extends Base } } + // Response models only filter nested Documents. Handing over the raw config arrays + // ships every key they carry, including the start, bundle and env commands that + // belong to the runtime image. + $frameworks = \array_map(fn (array $framework) => new Document(\array_replace($framework, [ + 'adapters' => \array_map( + fn (array $adapter) => new Document($adapter), + $framework['adapters'] ?? [] + ), + ])), \array_values($frameworks)); + $response->dynamic(new Document([ 'total' => count($frameworks), - 'frameworks' => \array_values($frameworks) + 'frameworks' => $frameworks ]), Response::MODEL_FRAMEWORK_LIST); } }