From 6239073e2a25d4c1e20d15971e9589e611544b50 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Tue, 1 Sep 2026 03:24:43 -0600 Subject: [PATCH] fix: strip git provider secrets from compose.one response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit findComposeById embedded the full github/gitlab/bitbucket/gitea relations (client secrets, OAuth tokens, private keys, app passwords) and compose.one only used canEditDeployGitSource to set a hasGitProviderAccess flag, never to hide the fields — so any member with read access to a compose service got the connected git provider's raw credentials, regardless of their access to that provider itself. Exclude the same secret columns findApplicationById already excludes. Deploys are unaffected: the actual clone step always re-fetches the provider fresh by id (findGithubById/findGitlabById/...), it never reads secrets off the embedded relation. --- packages/server/src/services/compose.ts | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/server/src/services/compose.ts b/packages/server/src/services/compose.ts index 35b1d5dc7..7f23c8220 100644 --- a/packages/server/src/services/compose.ts +++ b/packages/server/src/services/compose.ts @@ -125,10 +125,24 @@ export const findComposeById = async (composeId: string) => { deployments: true, mounts: true, domains: true, - github: true, - gitlab: true, - bitbucket: true, - gitea: true, + github: { + columns: { + githubClientSecret: false, + githubPrivateKey: false, + githubWebhookSecret: false, + }, + }, + gitlab: { + columns: { secret: false, accessToken: false, refreshToken: false }, + }, + bitbucket: { columns: { appPassword: false, apiToken: false } }, + gitea: { + columns: { + clientSecret: false, + accessToken: false, + refreshToken: false, + }, + }, server: true, backups: { with: {