CVE-2026-27598: Dagu Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-6v48-fcq6-ff23
CWE-22
Published
Advisory Summary

CVE-2026-27598 is a HIGH path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Dagu libraries in the Go ecosystem. The issue involves path traversal in dag creation allows arbitrary yaml file write outside dags directory. Remediation is available in the latest vendor maintenance releases.

CVE-2026-27598 at a Glance

CVE Identifier CVE-2026-27598
GHSA Identifier GHSA-6v48-fcq6-ff23
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Dagu
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-27598

To remediate this vulnerability, upgrade all affected Dagu dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/dagu-org/dagu fixed: Latest secure release
Upgrade github.com/dagu-org/dagu to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/dagu-org/dagu

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-27598, inspect your project dependencies for Dagu:

inspect dependencies for github.com/dagu-org/dagu

Analyze the terminal output to locate any version of Dagu in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Dagu, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The `CreateNewDAG` API endpoint (`POST /api/v1/dags`) does not validate the DAG name before passing it to the file store. While `RenameDAG` calls `core.ValidateDAGName()` to reject names containing path separators (line 273 in `dags.go`), `CreateNewDAG` skips this validation entirely and passes user input directly to `dagStore.Create()`. In `internal/persis/filedag/store.go`, the `generateFilePath` function (line 493) checks if the name contains a path separator, and if so, resolves it via `filepath.Abs(name)` — completely ignoring the `baseDir`. This means a name like `../../tmp/pwned` will write a file to `/tmp/pwned.yaml` instead of the DAGs directory. **Affected code:** `internal/service/frontend/api/v1/dags.go` line 120-170 — `CreateNewDAG` handler, no call to `ValidateDAGName` `internal/persis/filedag/store.go` line 493-498 — `generateFilePath` resolves absolute path when name contains separator `internal/persis/filedag/store.go` line 213 — `Create` calls `generateFilePath` and writes attacker-controlled YAML content to the resolved path **PoC:** ``` curl -X POST http://localhost:8080/api/v1/dags \ -H "Content-Type: application/json" \ -d '{ "name": "../../tmp/path-traversal-proof", "spec": "steps:\n - command: id > /tmp/pwned\n" }' ``` After this request, a file `/tmp/path-traversal-proof.yaml` will be created with the attacker-supplied content. The file will be written with the permissions of the dagu process. An authenticated user with DAG write permissions can write arbitrary YAML files anywhere on the filesystem (limited by the process permissions). Since dagu executes DAG files as shell commands, writing a malicious DAG to the DAGs directory of another instance or overwriting config files can lead to remote code execution.

CVE-2026-27598 Affected Dagu Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
github.com/dagu-org/dagu
Go
≤ 1.16.7

References

Frequently Asked Questions

What is CVE-2026-27598?
CVE-2026-27598 is a security vulnerability in Dagu involving Path traversal in DAG creation allows arbitrary YAML file write outside DAGs directory under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Dagu versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/dagu-org/dagu.
What version fixes CVE-2026-27598?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/dagu-org/dagu affected?
Yes, github.com/dagu-org/dagu is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2026-27598?
CVE-2026-27598 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for CVE-2026-27598?
Run the dependency tree command: 'inspect dependencies for github.com/dagu-org/dagu'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6v48-fcq6-ff23",
  "modified" : "2026-02-27T20:40:23Z",
  "published" : "2026-02-24T21:43:15Z",
  "aliases" : [ "CVE-2026-27598" ],
  "summary" : "Dagu: Path traversal in DAG creation allows arbitrary YAML file write outside DAGs directory",
  "details" : "The `CreateNewDAG` API endpoint (`POST /api/v1/dags`) does not validate the DAG name before passing it to the file store. While `RenameDAG` calls `core.ValidateDAGName()` to reject names containing path separators (line 273 in `dags.go`), `CreateNewDAG` skips this validation entirely and passes user input directly to `dagStore.Create()`.\n\nIn `internal/persis/filedag/store.go`, the `generateFilePath` function (line 493) checks if the name contains a path separator, and if so, resolves it via `filepath.Abs(name)` — completely ignoring the `baseDir`. This means a name like `../../tmp/pwned` will write a file to `/tmp/pwned.yaml` instead of the DAGs directory.\n\n**Affected code:**\n\n`internal/service/frontend/api/v1/dags.go` line 120-170 — `CreateNewDAG` handler, no call to `ValidateDAGName`\n\n`internal/persis/filedag/store.go` line 493-498 — `generateFilePath` resolves absolute path when name contains separator\n\n`internal/persis/filedag/store.go` line 213 — `Create` calls `generateFilePath` and writes attacker-controlled YAML content to the resolved path\n\n**PoC:**\n\n```\ncurl -X POST http://localhost:8080/api/v1/dags \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"../../tmp/path-traversal-proof\",\n    \"spec\": \"steps:\\n  - command: id > /tmp/pwned\\n\"\n  }'\n```\n\nAfter this request, a file `/tmp/path-traversal-proof.yaml` will be created with the attacker-supplied content. The file will be written with the permissions of the dagu process.\n\nAn authenticated user with DAG write permissions can write arbitrary YAML files anywhere on the filesystem (limited by the process permissions). Since dagu executes DAG files as shell commands, writing a malicious DAG to the DAGs directory of another instance or overwriting config files can lead to remote code execution.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/dagu-org/dagu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.16.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dagu-org/dagu/security/advisories/GHSA-6v48-fcq6-ff23"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27598"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dagu-org/dagu/commit/e2ed589105d79273e4e6ac8eb31525f765bb3ce4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dagu-org/dagu"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2026-4542"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-24T21:43:15Z",
    "nvd_published_at" : "2026-02-25T01:16:09Z"
  }
}