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=basicenabled - 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: truebutAuthRequiredleft as its Go zero value (false), and the middleware interpretsAuthRequired = falseas "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.,
AuthRequiredleft 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.

