dokploy icon indicating copy to clipboard operation
dokploy copied to clipboard

Crypto miner bot is scaning new Dokploy instances and compromize them as soon they're online. Disabling UI by default is a good idea.

Open blakyris opened this issue 3 months ago • 8 comments

What problem will this feature address?

I just reinstalled a VPS with Dokploy at OVH and was instantly compromised.

Here is the report from my initial audit:

  • Compromise is confirmed, and the attacker gained root access to the host.

  • The initial vector did not originate from the Mac: an ephemeral Alpine container named orch-key-inject-… injected a key into /root/.ssh/authorized_keys at 13:19:06 UTC.

  • Four seconds later, 51.68.xxx.x logged in via SSH as root using that key.

  • This session installed a fake docker-daemon, downloaded vltrig, and began mining on pool.hashvault.pro.

  • The same session installed a second piece of malware that is still active: /root/.orch-lab/orchestrator. It is scanning the Internet on port 3000 on a massive scale to find other vulnerable Dokploy instances.

  • It has already recorded 3 "hits" and contains its own SSH keys as well as binaries for multiple architectures, demonstrating a capability to spread.

  • The attacker's root key is still present, and the PermitRootLogin prohibit-password setting still allows it; therefore, they can return.

  • Dokploy is currently on v0.30.2. The appName vulnerability you mentioned affects versions <= 0.26.6, so it is likely not that specific CVE. However, the infection definitely entered via Dokploy/its Docker access: the injection container appeared right after Dokploy was exposed—before your legitimate registration at 13:31:56—which explains why we got an "Admin already exist" error immediately after installing Dokploy.

  • The Dokploy database contains a suspicious account containing "orch-lab"

  • The compromise is confirmed and root access was obtained; the fake miner was only part of the deployment, as a second malicious service (orchestrator-lab) was still active at the time of the last check and was aggressively scanning other Dokploy instances.

Describe the solution you'd like

Disabling the UI by default and let the user enable it via flags at installation is a good idea I think. OVH VPS cannot be fully protected by their Edge Firewall on VPS becuase rules does not applies to IPv6.

Describe alternatives you've considered

Security hardening is a MUST before anything, but you have to be more explicit on that.

Additional context

No response

Will you send a PR to implement it?

No

blakyris avatar Aug 21 '26 19:08 blakyris

DOK-678

linear-code[bot] avatar Aug 21 '26 19:08 linear-code[bot]

** Disclaimer, AI was used to help me syntax and gather the logs of the VPS.

This issue is still actively being exploited as of October 14, 2026, and IMHO this is a critical security issue that deserves urgent attention.

A freshly installed Debian 13 VPS running Dokploy was compromised shortly after installation. I also encountered the unexpected "Admin already exists" message during initial setup.

The attacker injected an SSH public key (dokploy) into both /root/.ssh/authorized_keys and /home/debian/.ssh/authorized_keys, then authenticated remotely and installed a cryptocurrency miner with root privileges.

Evidence from system logs:

20:11:36 authorized_keys modified (root and debian) 20:11:39 Accepted publickey for root from 162.35.126.21 ED25519 SHA256:McvZgDAEENdWn6Cds/TEL7pedj2nM3Yg8St1OVNkcVU 20:11:41 sudo: debian : COMMAND=/usr/bin/tee /etc/systemd/system/docker-daemon.service 20:11:41 sudo: debian : COMMAND=/usr/bin/systemctl enable --now docker-daemon.service 20:11:42 systemd: Started docker-daemon.service

The malicious service downloaded HashVault vltrig and connected to pool.hashvault.pro.

We also observed a short-lived Docker container starting and disappearing at 20:11:36, coinciding with the SSH key modifications, although we couldn't conclusively establish the initial entry point.

The compromise is confirmed; the exact injection mechanism is not.

Please treat this as a high-priority security incident. A fresh Dokploy installation should not be vulnerable to automated root compromise during initial setup.

jParaskevopoulos avatar Oct 15 '26 11:10 jParaskevopoulos

Additional OVH host-compromise observation

I observed another host-level compromise on a single-node OVH Ubuntu VPS after installing Dokploy with the documented installer (curl -sSL https://dokploy.com/install.sh | sh). The exact Dokploy image tag was not recorded before Docker was stopped.

During first access, the UI went directly to the login page and showed an existing account, [email protected], which I had not created.

Relevant host evidence (2026-10-18, UTC):

  • At 06:46:17, /root/.ssh/authorized_keys and /home/ubuntu/.ssh/authorized_keys were modified to include the same dokploy ED25519 key (SHA256:DGAHdjgqi7SpVVorWEHWNzHCxyyKRK09tBYBtb6y+AE).
  • The Docker journal recorded a container task deletion at the same second (ID 800d244f406d). Its container metadata was no longer present, so I could not recover its name, image, or command.
  • Between 06:46:21 and 06:46:27, sshd accepted five public-key logins as root and ubuntu from 187.77.129.67, using that fingerprint. This is the source address recorded by sshd; I cannot attribute it to a person or operator.
  • At 06:46:28, /etc/systemd/system/docker-daemon.service was created. It ran as root, was enabled at boot, and downloaded HashVault/vltrig v6.25.0.4. Its logs show connections to pool.hashvault.pro:443.
  • SHA-256: service unit ee156fb3fbfe818726a8ed093a1b67df7eb86dcddf0d30dac139b4547d14595a; /bin/docker-daemon eb57ca3dbad519573d65317a8b35ddfb6921e6cf6d44aafd466f856283e28803.

The initial entry vector is not proven. The Docker task deletion and key-file modifications share a timestamp, which is consistent with a short-lived container injecting the key, but the deleted container's metadata was unavailable, so I cannot identify it as orch-key-inject or establish how it was launched.

I stopped and disabled the fake systemd service and removed the unauthorized key from both live authorized_keys files. I preserved root-only copies of the original files. No session from the recorded source IP was active during the final check. I am treating the host as compromised and will reinstall it rather than consider it clean.

Proposed mitigations:

  1. Bootstrap the initial Owner through the installer over SSH, before exposing the panel. Prompt for the email and password through a hidden TTY input, or generate a one-time credential and display it once. Do not pass the password as a command-line argument or leave it in shell history.
  2. Keep port 3000 unpublished or bound to loopback until bootstrap succeeds. Provide an SSH-tunnel setup path, then require an explicit opt-in to expose the panel, preferably behind HTTPS and a VPN or source-IP allowlist.
  3. Make initial registration atomic and one-time. If a fresh install finds an existing Owner or unexpected account, fail closed and show a high-visibility warning instead of silently showing the normal login page.
  4. Treat the Dokploy web/control plane's Docker access as host-root-equivalent. Longer term, isolate the deployment agent from the public-facing panel and avoid giving the web process unrestricted access to the host Docker socket.
  5. Add fresh-install regression tests: verify externally over IPv4 and IPv6 that the UI is not reachable before bootstrap, registration is disabled after Owner creation, and the installer does not add SSH keys or unrelated host services.

The exact entry vector still needs investigation. These bootstrap and exposure changes would reduce the first-run attack window, but would not by themselves prevent a separate Docker or host-level vulnerability.

arokglez avatar Oct 18 '26 07:10 arokglez

Same campaign hit a fresh install today (2026-10-20). Adding evidence in case it helps.

Setup: Dokploy v0.30.8, Ubuntu 26.04, Hetzner, Docker 29, official install script, port 3000 reachable from the internet.

Timeline (UTC)

  • 00:21: installer finishes.
  • 00:23:07: an attacker-controlled owner account was registered by an automated client (Go-http-client/1.1). All 4 sessions in the session table come from the same source.
  • 00:23:09: compose orch-key-inject-<rand> deployed (raw compose, alpine:3.20, privileged: true, network_mode: none, /:/host:rw). A base64 payload appends an ed25519 key with comment dokploy to /root/.ssh/authorized_keys and to /home/{debian,ubuntu,admin,user}/.ssh/authorized_keys if those exist.
  • 00:23:58: compose orch-unit-install-<rand> deployed (same container shape). It writes /etc/systemd/system/docker-daemon.service, tries chroot /host systemctl enable --now, cleans up its sibling orch-* / inject-key containers, and prints a host fingerprint (hostname, OS, CPU, RAM, disk, IPs, virt, DMI vendor).

The second stage matches the original report: once the key is in, the bot logs in as root over SSH.

Indicators

  • Container and compose names: orch-key-inject-*, orch-unit-install-* (the cleanup step also targets orch-arch, orch-mkdir, orch-put, orch-go, orch-key, orch-ver, k8s_POD_).
  • Unit docker-daemon.service ("Docker support daemon for system"). It downloads vltrig-v6.25.0.4-linux-x64.tar.gz from github.com/HashVault/vltrig releases, moves it to /bin/docker-daemon, and runs it with -u 895Hw5mVfe7YcToj57ZRgEa6zsm13fq52RHie4aMTCqKFoJKhVrXE93PyucitYiuwg6ouEgAgir8TeemaNBboTgm2NTbSrN -p dkp713900f504e6dba38a53757e8a09b --donate-level=0 --randomx-1gb-pages --cpu-max-threads-hint=80.

Outcome here: PermitRootLogin no was already set, so the injected root key couldn't be used. Enabling the unit failed (unit disabled and inactive, no binary on disk, no miner process). I found no other deployments, API keys or SSH logins from the attacker. I wiped Dokploy's data and reinstalled with :3000 firewalled first, then registered through an SSH tunnel (ssh -L 3000:localhost:3000).

Advice for others: block :3000 from the internet before running the installer, or register within seconds. The window was about 2 minutes. If you were hit, check /root/.ssh/authorized_keys for a dokploy key, /etc/systemd/system/docker-daemon.service, /bin/docker-daemon, /root/.orch-lab, and stopped orch-* containers.

+1 to the feature request: a one-time setup token printed by the installer (or binding :3000 to localhost until the first admin exists) would close this race.


Suggested fixes

Ordered from the one that closes the hole to defense in depth:

  1. One-time setup token (closes the race). The installer generates a random token, stores it (e.g. /etc/dokploy/setup-token, root-only) and prints it along with the URL. /register and the first-owner flow reject requests without it while no owner exists, and the token is deleted after the first owner is created. Same pattern as Jenkins' initialAdminPassword or Grafana/Gitea-style first-run secrets. A bot scanning :3000 then gets nothing.
  2. Registration time window. As a fallback when no token is given: if no owner is created within N minutes of first boot (Portainer uses 5), lock registration until the service restarts. This turns a permanent hole into a small, visible window.
  3. Localhost-only first run (opt-in flag). curl … | DOKPLOY_FIRST_RUN_LOCAL=1 sh accepts registration only from 127.0.0.1, so the owner signs up over ssh -L 3000:localhost:3000. Same idea for setting the panel domain at install time (--domain panel.example.com) and closing :3000 once HTTPS works.
  4. Guardrails on raw compose. Every stage of this attack was a raw compose with privileged: true + /:/host:rw. A per-organization policy that blocks (or requires an explicit owner toggle plus a confirmation for) privileged, host-root bind mounts, /var/run/docker.sock, pid: host and network_mode: host would have stopped it even with the owner account taken. A brand-new organization should default to "blocked".
  5. Security notifications and audit. Emit audit and notification events for owner creation, new sessions from a new IP, and deployments that request privileged or host mounts. A banner after the first login showing when and from where the owner was created would make a hijacked install obvious.
  6. Installer hardening hints. Warn when :3000 is publicly reachable and remind users that Docker-published ports bypass UFW, so they should filter via the DOCKER-USER chain or a cloud firewall. Offer a "Disable IP:3000 access" toggle once a panel domain is set.

(1) alone fixes the issue. (4) limits the damage if an account is ever compromised in another way.

Docker-Hunterpedia avatar Oct 20 '26 00:10 Docker-Hunterpedia

Is this still a thing? I installed Dokploy the usual way, waited a ton of time to register, go onto my instance and there's no register screen, just sign in. I tried to find the /root/.orch-lab and other directories that were supposedly hit by malware using grep, but unable to find those directories as they don't exist. I'm thinking something hit my instance, because why else would a fresh install only show me a login screen?

EDIT: yep been hit. I ran docker exec $(docker ps -qf name=dokploy-postgres) psql -U dokploy -d dokploy -c "SELECT u.email FROM \"user\" u JOIN member m ON u.id = m.user_id WHERE m.role = 'owner';" to see what email was used and it came through as [email protected].

v01px0 avatar Nov 12 '26 23:11 v01px0

@arokglez how can I find when a key was modified? All my keys are named the same, even the malicious ones. My host name, tunneled through Tailscale, is shortened, which I'll change here very soon, to dokploy so there's no way for me to tell which key is which.

v01px0 avatar Nov 13 '26 00:11 v01px0

Is this still a thing? I installed Dokploy the usual way, waited a ton of time to register, go onto my instance and there's no register screen, just sign in. I tried to find the /root/.orch-lab and other directories that were supposedly hit by malware using grep, but unable to find those directories as they don't exist. I'm thinking something hit my instance, because why else would a fresh install only show me a login screen?

EDIT: yep been hit. I ran docker exec $(docker ps -qf name=dokploy-postgres) psql -U dokploy -d dokploy -c "SELECT u.email FROM \"user\" u JOIN member m ON u.id = m.user_id WHERE m.role = 'owner';" to see what email was used and it came through as [email protected].

Yep, same here. I left one of my dev server ownerless and I just found the malware running on it.

Pluzdev avatar Nov 18 '26 12:11 Pluzdev

Confirmed Host-Root Compromise Immediately After Fresh Dokploy v0.31.2 Installation

Severity: Critical — confirmed host-root compromise

Affected version: Dokploy v0.31.2

Date of incident: November 22, 2026

Environment: Hetzner Cloud VPS, Ubuntu 24.04 LTS, Docker 28.x, single-node Docker Swarm.

Summary

I am reporting a confirmed security incident that occurred immediately after installing Dokploy v0.31.2 on a VPS hosting several personal applications.

Before I could complete the legitimate administrator onboarding process, an unauthorized account had been created in the Dokploy database.

The attacker subsequently obtained SSH access as root and installed a persistent cryptocurrency miner.

This is not a theoretical vulnerability report. I verified the malicious systemd service, the running mining process, the unauthorized SSH login, and the corresponding public-key fingerprint.

Timeline (UTC)

  • 18:53:33 — A suspicious user and organization owner membership were created in the Dokploy database.
  • 18:53:39 — SSH logs recorded a successful root login from 95.111.238.35 using an unauthorized public key.
  • 18:53:41 — A malicious systemd service, docker-daemon.service, was installed.

The account had an email address matching la***@localhost.local and an owner membership. The user record was marked as not registered.

Evidence

The malicious service was located at:

/etc/systemd/system/docker-daemon.service

It downloaded and executed the vltrig cryptocurrency miner using the misleading executable name:

/bin/docker-daemon

At the time of inspection, the miner consumed approximately 294% CPU and 2.4 GB RAM.

The attacker's SSH public key was present in /root/.ssh/authorized_keys.

Its fingerprint was:

SHA256:SSkaDtNpUiQURMv8pCWAPLzI3El4kUSApkEeO61OsrM

The SSH logs confirmed successful authentication as root using this fingerprint.

SHA-256 of the malicious systemd service:

ee156fb3fbfe818726a8ed093a1b67df7eb86dcddf0d30dac139b4547d14595a

SHA-256 of the malicious executable:

eb57ca3dbad519573d65317a8b35ddfb6921e6cf6d44aafd466f856283e28803

Potential impact

The compromised VPS also hosted other applications and developer infrastructure, including:

  • GitHub App private keys and repository deployment credentials
  • Cloudflare Tunnel credentials
  • MCP gateway credentials
  • Application configuration and secrets
  • Persistent application data and source-code checkouts

Because the attacker obtained root access, all locally accessible secrets must be considered potentially exposed.

I have not established whether application data was exfiltrated.

Related prior report

This incident appears closely related to:

https://github.com/Dokploy/dokploy/issues/5156

The behavior is remarkably similar: unauthorized onboarding, SSH key injection, root access, and deployment of a fake Docker daemon running a cryptocurrency miner.

My incident occurred with Dokploy v0.31.2, demonstrating that this attack pattern was still observed on November 22, 2026.

I cannot yet establish the precise exploitation mechanism or whether it involves a previously disclosed vulnerability.

Mitigation performed

  • Stopped and disabled the malicious systemd service.
  • Disabled the Dokploy application service.
  • Revoked affected GitHub credentials.
  • Began revoking other infrastructure credentials.
  • Initiated preparations for a complete VPS rebuild from a clean operating system image.

Request to maintainers

Could you please investigate whether Dokploy's initial administrator registration and default public exposure during installation can enable this attack?

I strongly recommend considering:

  1. Binding initial setup to localhost by default, or requiring a unique installation-time secret.
  2. Preventing remote administrative registration until the operator explicitly enables it.
  3. Warning prominently that exposing port 3000 before onboarding is dangerous.
  4. Reviewing whether initial account creation can lead to host-level Docker or SSH access.
  5. Documenting affected versions, detection indicators, and mitigation procedures.

I would appreciate confirmation of whether this is a known attack path and whether current releases include effective protections.

I can provide additional sanitized evidence privately.

Thank you for investigating.

enzomar avatar Nov 22 '26 19:11 enzomar