/

CVE-2026-31882

Severity:

HIGH RISK

(7.5)

Missing Authentication in Dagu Workflow Engine

CVE-2026-31882

Analyzed

Vulnerability type

Category:

Missing Authentication

CWE:

CWE-306

Impact:

Exposure of Sensitive Workflow and Execution Data

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Dagu's web UI exposes several Server-Sent Events (SSE) endpoints that remain accessible without authentication when HTTP Basic authentication is enabled.

An unauthenticated attacker can passively connect to these SSE streams to view real-time workflow execution data, configurations, logs, and queue status, effectively bypassing intended REST API protection.

Affected context

The vulnerability occurs in Dagu deployments that:

  • Run the built-in Web UI with DAGU_AUTH_MODE=basic enabled
  • Rely on HTTP Basic authentication to protect workflow operations and monitoring data
  • Expose the Dagu UI (and therefore SSE endpoints) to users beyond a fully trusted, isolated network

In this context, all SSE/streaming endpoints are reachable without credentials, even though the REST API requires authentication, creating an inconsistent protection boundary.

Exploit preconditions

  • Attack surface: Network-accessible Dagu Web UI, specifically SSE/streaming endpoints
  • Required access: Ability to reach the Dagu UI over HTTP/HTTPS; no valid credentials are needed
  • Trigger point: Opening an SSE connection (e.g., via browser, curl, or custom client) to the streaming endpoints while the instance uses Basic authentication mode
  • Why exploitation is possible: The authentication options for SSE are built with BasicAuthEnabled: true but AuthRequired left as its Go zero value (false), and the middleware interprets AuthRequired = false as "allow unauthenticated access," effectively disabling auth on these endpoints.

Why this happens

This issue stems from inconsistent enforcement of authentication requirements across different HTTP endpoints in the same service.

The function responsible for building authentication options for SSE/streaming routes sets a flag indicating Basic auth support but does not explicitly require authentication, relying on a default value for AuthRequired.

The middleware logic treats a false (default) AuthRequired value as permission to allow unauthenticated access.

This pattern maps to CWE-306: Missing Authentication for Critical Function, where a security-sensitive interface—here, real-time workflow monitoring and configuration visibility—is exposed without mandatory authentication despite the presence of an authentication mechanism elsewhere.

Potential impact

  • Unauthenticated access to real-time Directed Acyclic Graph (DAG) execution events and status
  • Exposure of workflow configurations that may contain operational details or environmental assumptions
  • Disclosure of execution logs, which can include sensitive information such as file paths, system behavior, internal error messages, or misconfigured secrets
  • Leakage of queue status and operational metadata that could be used to profile system workloads and timing
  • Assistance in planning further attacks by revealing internal architecture and behavior patterns

General mitigation guidance

Effective mitigation focuses on enforcing consistent authentication requirements and tightening exposure of monitoring interfaces:

  • Ensure that all SSE/streaming endpoints share the same authentication and authorization requirements as their corresponding REST API endpoints.
  • Avoid relying on default or zero values for security-critical flags such as AuthRequired; explicitly set authentication requirements for every route group.
  • Centralize authentication policy so that new endpoints automatically inherit secure defaults, rather than opt-in security.
  • Restrict network exposure of the Dagu Web UI to trusted networks, VPNs, or reverse proxies that enforce their own authentication and access control.
  • Apply the principle of least privilege to monitoring data access, limiting sensitive workflow visibility to roles that genuinely require it.

How teams detect issues like this

Detection typically combines configuration review with behavioral and code-level checks:

  • Review route registration and middleware wiring to confirm that all SSE/streaming endpoints are wrapped with the same authentication middleware as REST endpoints.
  • Use static analysis or code search to flag any authentication options where an endpoint is marked as "auth-capable" but does not explicitly require authentication (e.g., AuthRequired left at its default).
  • Instrument HTTP access logs to identify SSE endpoints being accessed by anonymous or unauthenticated users and alert on unexpected patterns.
  • Incorporate security-focused code review checklists that explicitly ask whether every new endpoint, including streaming and event feeds, enforces authentication and authorization consistently.

Sources

SourceLink
github.comgithub.com/dagu-org/dagu/commit/064616c9b80c04824c1c7c357308f77f3f24d775
github.comgithub.com/dagu-org/dagu/pull/1752
github.comgithub.com/dagu-org/dagu/releases/tag/v2.2.4
github.comgithub.com/dagu-org/dagu/security/advisories/GHSA-9wmw-9wph-2vwp

Frequently asked

questions

Yes, as long as the Dagu Web UI is reachable over the network (for example, exposed to the internet or a broader internal network), an unauthenticated attacker can connect to the SSE endpoints without credentials.

No. When Basic authentication mode is enabled, the REST API is protected, but SSE endpoints can still be accessed without any credentials due to the missing AuthRequired enforcement.

The safest pattern is to treat all externally reachable endpoints—including SSE, WebSocket, and other streaming interfaces—as protected by default, explicitly requiring authentication and authorization and centralizing this logic in shared middleware or routing configuration.

Adopt secure defaults for all security-related flags, enforce authentication at a common entry point for all routes, extend threat modeling to include monitoring and streaming interfaces, and use automated checks in code review and CI pipelines to verify that any new endpoint cannot bypass the standard authentication path.

Find out what's already
exploitable in your codebase.