Merge pull request #4857 from Dokploy/fix/idor-server-ssh-key-disclosure

fix(security): SSH private key disclosure via server read endpoints
This commit is contained in:
Mauricio Siu
2026-07-19 21:22:56 -06:00
committed by GitHub
3 changed files with 68 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import {
getPublicIpWithFallback,
haveActiveServices,
IS_CLOUD,
redactServerSshKey,
removeDeploymentsByServerId,
serverAudit,
serverSetup,
@@ -105,7 +106,7 @@ export const serverRouter = createTRPCRouter({
});
}
return server;
return redactServerSshKey(server);
}),
getDefaultCommand: withPermission("server", "read")
.input(apiFindOneServer)
@@ -436,7 +437,7 @@ export const serverRouter = createTRPCRouter({
await updateServersBasedOnQuantity(admin.id, admin.serversQuantity);
}
return currentServer;
return redactServerSshKey(currentServer);
} catch (error) {
throw error;
}