Merge pull request #4858 from Dokploy/fix/idor-swarm-cross-org

fix(security): cross-org IDOR + nodeId injection in swarm read endpoints
This commit is contained in:
Mauricio Siu
2026-07-19 21:28:53 -06:00
committed by GitHub
3 changed files with 83 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ import {
execAsync,
execAsyncRemote,
} from "@dokploy/server/utils/process/execAsync";
import { quote } from "shell-quote";
export const getContainers = async (serverId?: string | null) => {
try {
@@ -519,7 +520,7 @@ export const getSwarmNodes = async (serverId?: string) => {
export const getNodeInfo = async (nodeId: string, serverId?: string) => {
try {
const command = `docker node inspect ${nodeId} --format '{{json .}}'`;
const command = `docker node inspect ${quote([nodeId])} --format '{{json .}}'`;
let stdout = "";
let stderr = "";
if (serverId) {