{"id":"CVE-2026-27598","aliases":["CVE-2026-27598","GHSA-6v48-fcq6-ff23","GO-2026-4542"],"related":[],"kind":"vulnerability","state":"published","title":"Dagu: Path traversal in DAG creation allows arbitrary YAML file write outside DAGs directory","summary":"Dagu is a workflow engine with a built-in Web user interface. In versions up to and including 1.16.7, the `CreateNewDAG` API endpoint (`POST /api/v1/dags`) does not validate the DAG name before passing it to the file store. 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. Commit e2ed589105d79273e4e6ac8eb31525f765bb3ce4 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Dagu is a workflow engine with a built-in Web user interface. In versions up to and including 1.16.7, the `CreateNewDAG` API endpoint (`POST /api/v1/dags`) does not validate the DAG name before passing it to the file store. 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. Commit e2ed589105d79273e4e6ac8eb31525f765bb3ce4 fixes the issue.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Dagu: Path traversal in DAG creation allows arbitrary YAML file write outside DAGs directory in github.com/dagu-org/dagu","format":"markdown","source":"go"},{"lang":"es","text":"Dagu es un motor de flujo de trabajo con una interfaz de usuario web integrada. En versiones hasta la 1.16.7 inclusive, el endpoint de la API 'CreateNewDAG' ('POST /api/v1/dags') no valida el nombre del DAG antes de pasarlo al almacén de archivos. Un usuario autenticado con permisos de escritura de DAG puede escribir archivos YAML arbitrarios en cualquier lugar del sistema de archivos (limitado por los permisos del proceso). Dado que dagu ejecuta archivos DAG como comandos de shell, escribir un DAG malicioso en el directorio de DAGs de otra instancia o sobrescribir archivos de configuración puede conducir a ejecución remota de código. El commit e2ed589105d79273e4e6ac8eb31525f765bb3ce4 soluciona el problema.","source":"nvd"}],"published":"2026-02-24T21:43:15.000Z","modified":"2026-06-17T10:27:22.060Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"<= 1.16.7","status":"affected"}],"vendor":"dagu-org","product":"dagu","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"1.16.7"}],"ecosystem":"Go","package":"github.com/dagu-org/dagu","purl":"pkg:golang/github.com/dagu-org/dagu","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/dagu-org/dagu","purl":"pkg:golang/github.com/dagu-org/dagu","source":"go"},{"ranges":[{"status":"affected","lastAffected":"1.16.7"}],"vendor":"dagu","product":"dagu","cpe":"cpe:2.3:a:dagu:dagu:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/dagu-org/dagu/security/advisories/GHSA-6v48-fcq6-ff23","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/dagu-org/dagu/commit/e2ed589105d79273e4e6ac8eb31525f765bb3ce4","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27598","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/dagu-org/dagu","tags":["package"],"sources":["ghsa"]},{"url":"https://pkg.go.dev/vuln/GO-2026-4542","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-02-26T21:02:05.743Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-27598","url":"https://www.cve.org/CVERecord?id=CVE-2026-27598","licence":"CVE Terms of Use","modified":"2026-02-26T21:02:19.359Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6v48-fcq6-ff23","url":"https://github.com/advisories/GHSA-6v48-fcq6-ff23","licence":"CC-BY-4.0","modified":"2026-02-28T06:26:47.378Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4542","url":"https://pkg.go.dev/vuln/GO-2026-4542","licence":"CC-BY-4.0","modified":"2026-02-25T23:41:03.132Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-27598","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27598","licence":"Public domain","modified":"2026-06-17T10:27:22.060Z"}],"updatedAt":"2026-11-25T22:59:14.792Z","epss":{"score":0.01769,"percentile":0.7878,"date":"2026-12-01T12:00:22.000Z"}}