CVE-2026-27598
Arbitrary File Write in Dagu DAG API Enables RCE
Publication date: 2026-02-25
Last updated on: 2026-02-25
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| dagu | dagu | to 1.16.7 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-22 | 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. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
[{'type': 'paragraph', 'content': 'CVE-2026-27598 is a path traversal vulnerability in the DAG creation API endpoint of the Dagu workflow engine (versions up to and including 1.16.7). The vulnerability occurs because the CreateNewDAG API endpoint does not validate the DAG name before passing it to the file storage layer. This allows an authenticated user with DAG write permissions to specify DAG names containing path traversal sequences (like "../../") that cause the system to write arbitrary YAML files anywhere on the filesystem within the process\'s permission scope.'}, {'type': 'paragraph', 'content': 'Since Dagu executes DAG files as shell commands, an attacker can exploit this vulnerability to write malicious DAG files to the DAGs directory of another instance or overwrite configuration files, potentially leading to remote code execution.'}] [1]
How can this vulnerability impact me? :
This vulnerability can have serious impacts including unauthorized file creation or modification anywhere on the filesystem accessible by the Dagu process. An attacker with DAG write permissions can write arbitrary YAML files outside the intended directory, potentially overwriting critical configuration files or injecting malicious DAGs.
Because Dagu executes DAG files as shell commands, this can lead to remote code execution, allowing an attacker to run arbitrary commands on the affected system.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability be detected on my network or system? Can you suggest some commands?
[{'type': 'paragraph', 'content': 'This vulnerability can be detected by monitoring for unauthorized or suspicious POST requests to the CreateNewDAG API endpoint at /api/v1/dags that include DAG names containing path traversal patterns such as "..", "/", or "\\". An authenticated user with DAG write permissions sending such requests may indicate exploitation attempts.'}, {'type': 'paragraph', 'content': 'You can detect potential exploitation by inspecting logs or using commands to search for suspicious DAG files created outside the intended DAGs directory, for example files with unusual paths or names.'}, {'type': 'list_item', 'content': 'Check web server or application logs for POST requests to /api/v1/dags with DAG names containing path separators or traversal sequences.'}, {'type': 'list_item', 'content': "Use filesystem commands to find recently created or modified YAML files outside the normal DAGs directory, for example: find / -name '*.yaml' -mtime -7"}, {'type': 'list_item', 'content': 'If you have access to the dagu process logs or audit logs, look for errors or warnings related to DAG creation or file writes with suspicious paths.'}] [1]
What immediate steps should I take to mitigate this vulnerability?
[{'type': 'paragraph', 'content': 'Immediate mitigation steps include restricting access to the CreateNewDAG API endpoint to trusted and authenticated users with DAG write permissions only.'}, {'type': 'paragraph', 'content': 'Since the vulnerability is fixed in commit e2ed589105d79273e4e6ac8eb31525f765bb3ce4, apply this patch or upgrade to a version that includes this fix as soon as possible.'}, {'type': 'list_item', 'content': 'Implement strict validation of DAG names to reject names containing path traversal characters or sequences such as "..", "/", or empty names.'}, {'type': 'list_item', 'content': 'Ensure that the file storage layer sanitizes and constrains file paths to remain within the designated DAGs directory.'}, {'type': 'list_item', 'content': 'Monitor and audit DAG creation activities for suspicious or unauthorized file writes.'}] [2]