fix(security): escape dockerImage in database service remote docker pull

The deploy functions for postgres/mysql/mariadb/mongo/redis/libsql interpolated
the user-settable dockerImage field unquoted into 'docker pull ${dockerImage}'
executed via execAsyncRemote (SSH) on the remote server path. Now passed through
shell-quote. The local path already used pullImage() (execFile-based) and is
unaffected.

Closes GHSA-6jrh-8qmg-jj3p
This commit is contained in:
Mauricio Siu
2026-07-19 22:45:31 -06:00
parent 0348f5fb38
commit b24202e69b
7 changed files with 53 additions and 6 deletions

View File

@@ -11,6 +11,7 @@ import { pullImage } from "@dokploy/server/utils/docker/utils";
import { execAsyncRemote } from "@dokploy/server/utils/process/execAsync";
import { TRPCError } from "@trpc/server";
import { eq, getTableColumns } from "drizzle-orm";
import { quote } from "shell-quote";
import type { z } from "zod";
import { validUniqueServerAppName } from "./project";
@@ -155,7 +156,7 @@ export const deployPostgres = async (
if (postgres.serverId) {
await execAsyncRemote(
postgres.serverId,
`docker pull ${postgres.dockerImage}`,
`docker pull ${quote([postgres.dockerImage])}`,
onData,
);
} else {